Skip to content

Commit

Permalink
✨ [#1938] Expanded allowed CSS properties and set some NLDS classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jiromaykin committed Dec 14, 2023
1 parent 7d9743b commit aa3a934
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/open_inwoner/cms/banner/tests/test_plugin_banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_banner_text_is_rendered_in_plugin(self):
BannerTextPlugin, plugin_data={"title": title}
)

self.assertIn(f'<h1 class="h1">{title} </h1>', html)
self.assertIn(f'<h1 class="utrecht-heading-1">{title} </h1>', html)

def test_banner_text_with_description_is_rendered_in_plugin(self):
title = "A title for the banner"
Expand All @@ -48,5 +48,5 @@ def test_banner_text_with_description_is_rendered_in_plugin(self):
BannerTextPlugin, plugin_data={"title": title, "description": description}
)

self.assertIn(f'<h1 class="h1">{title} </h1>', html)
self.assertIn(f'<h1 class="utrecht-heading-1">{title} </h1>', html)
self.assertIn(f'<p class="p">{description}</p>', html)
5 changes: 5 additions & 0 deletions src/open_inwoner/scss/components/Typography/H1.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@
h1 + .card-container {
margin-top: var(--gutter-width);
}

.utrecht-heading-1 {
font-size: var(--utrecht-heading-1-font-size);
font-weight: var(--utrecht-heading-1-font-weight);
}
5 changes: 5 additions & 0 deletions src/open_inwoner/scss/components/Typography/H2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@
.p + .h2 {
margin-top: var(--spacing-large);
}

.utrecht-heading-2 {
font-size: var(--utrecht-heading-2-font-size);
font-weight: var(--utrecht-heading-2-font-weight);
}
5 changes: 5 additions & 0 deletions src/open_inwoner/scss/components/Typography/H3.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
.p + .h3 {
margin-top: var(--spacing-large);
}

.utrecht-heading-3 {
font-size: var(--utrecht-heading-3-font-size);
font-weight: var(--utrecht-heading-3-font-weight);
}
4 changes: 2 additions & 2 deletions src/open_inwoner/templates/cms/banner/banner_text_plugin.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 class="h1">{{ instance.title }} {{ request.user.get_full_name }}</h1>
<h1 class="utrecht-heading-1">{{ instance.title }} {{ request.user.get_full_name }}</h1>

{% if instance.description %}
<p class="p">{{ instance.description|linebreaksbr }}</p>
{% endif %}
{% endif %}
2 changes: 1 addition & 1 deletion src/open_inwoner/templates/master.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load static i18n header_tags card_tags button_tags link_tags notification_tags anchor_menu_tags logo_tags view_breadcrumbs utils session_tags django_htmx cms_tags menu_tags sekizai_tags %}<!DOCTYPE html>
<html lang="nl" class="view {% block view_class %}view--{{ request.resolver_match.namespaces|join:'-' }}-{{ request.resolver_match.url_name }}{% endblock %}">
<html lang="nl" class="view {% block view_class %}view--{{ request.resolver_match.namespaces|join:'-' }}-{{ request.resolver_match.url_name }}{% endblock %} openinwoner-theme">
<head>
<meta charset="utf-8">
<title>{% block title %}{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}{% endblock %}</title>
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="home">
{% block user_content %}
<div class="grid__welcome">
<h1 class="h1">{{configurable_text.home_page.home_welcome_title}}</h1>
<h1 class="utrecht-heading-1">{{configurable_text.home_page.home_welcome_title}}</h1>
<p class="p">{{configurable_text.home_page.home_welcome_intro|linebreaksbr}}</p>
</div>
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/templates/pages/user-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% block header_image %}{% endblock header_image %}

{% block user_content %}
<h1 class="h1">{{ configurable_text.home_page.home_welcome_title }} {{ request.user.get_full_name }}</h1>
<h1 class="utrecht-heading-1">{{ configurable_text.home_page.home_welcome_title }} {{ request.user.get_full_name }}</h1>
<p class="p">{{ configurable_text.home_page.home_welcome_intro|linebreaksbr }}</p>

{% if show_plans %}
Expand Down
60 changes: 52 additions & 8 deletions src/open_inwoner/utils/css.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,72 @@
# CSS properties
#
# "azimuth",
"align-content",
"align-items",
"align-self",
"all",
"animation",
"background-clip",
"background-color",
"border-bottom-color",
"background-image",
"background-origin",
"background-position",
"background-repeat",
"background-size" "border-bottom-color",
"border-collapse",
"border-color",
"border-left-color",
"border-right-color",
"border-top-color",
# "clear",
"clear",
"color",
"cursor",
# "direction",
# "display",
"display",
# "elevation",
# "float",
"float",
"font",
"@font-face",
"font-family",
"font-size",
"font-style",
"font-variant",
"font-weight",
# "height",
"height",
"@import",
"justify-content",
"@keyframes",
"left",
"letter-spacing",
"line-height",
# "overflow",
"list-style",
"list-style-image",
"list-style-position",
"list-style-type",
"margin",
"margin-bottom",
"margin-left",
"margin-right",
"margin-top",
"max-height",
"max-width",
"@media",
"min-height",
"min-width",
"overflow",
# "pause",
# "pause-after",
# "pause-before",
# "pitch",
# "pitch-range",
"padding",
"padding-bottom",
"padding-left",
"padding-right",
"padding-top",
"pointer-events",
"position",
"@property",
# "richness",
# "speak",
# "speak-header",
Expand All @@ -45,12 +82,19 @@
"text-align",
"text-decoration",
"text-indent",
# "unicode-bidi",
"text-transform",
"vertical-align",
"visibility",
# "unicode-bidi",
# "voice-family",
# "volume",
"white-space",
# "width",
"width",
"word-break",
"word-spacing",
"word-wrap",
"writing-mode",
"z-index",
#
# SVG properties
#
Expand Down

0 comments on commit aa3a934

Please sign in to comment.