Skip to content

Commit

Permalink
Isolate djlint bug
Browse files Browse the repository at this point in the history
  • Loading branch information
davepeck committed Mar 29, 2024
1 parent 138525a commit 26186b0
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 11 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ extend-ignore = [
blank_line_before_tag = "block"
blank_line_after_tag = "endblock"
use_gitignore = true
format_css = false
profile = "django"
format_css = true
indent = 2

[tool.djlint.css]
indent_size = 2
Expand Down
2 changes: 2 additions & 0 deletions server/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
html {
font-size: 16px;
font-family: var(--font-sans);
background-color: black;
color: white;
}


Expand Down
2 changes: 1 addition & 1 deletion server/vb/templates/base.dhtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
VoterBowl, coming soon.
<div>
<style>
me {
self {
background: blue;
color: white;
}
Expand Down
4 changes: 2 additions & 2 deletions server/vb/templates/components/logo.dhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% with width=width|default:"32px" height=height|default:"32px" %}
<div>
<style>
me {
self {
display: flex;
align-items: center;
border-radius: 100%;
Expand All @@ -10,7 +10,7 @@
height: {{ height }};
background-color: {{ logo.bg_color }};
}
me img {
self img {
display: block;
margin: 0 auto;
max-width: 80%;
Expand Down
12 changes: 6 additions & 6 deletions server/vb/templates/components/logo_specimen.dhtml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{% with width=width|default:"32px" height=height|default:"32px" %}
<div>
<style>
me {
self {
display: flex;
gap: 0.5rem;
}

me .bubble {
self .bubble {
display: flex;
align-items: center;
overflow: hidden;
}

me .bubble img {
self .bubble img {
display: block;
margin: 0 auto;
max-width: 80%;
max-height: 80%;
}

me .bg {
self .bg {
display: flex;
font-weight: 600;
align-items: center;
Expand All @@ -28,7 +28,7 @@
padding-right: 0.5rem;
}

me .action {
self .action {
display: flex;
font-weight: 600;
align-items: center;
Expand All @@ -38,7 +38,7 @@
transition: opacity 0.2s;
}

me .action:hover {
self .action:hover {
opacity: 0.7;
transition: opacity 0.2s ease-in-out;
}
Expand Down
7 changes: 7 additions & 0 deletions server/vb/templates/example.dhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div>
{# djlint:off #}
<style>
</style>
{# djlint:on #}
<p>Hello, world!</p>
</div>
2 changes: 1 addition & 1 deletion server/vb/templates/home.dhtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% block body %}
<div>
<style>
me h1 {
self h1 {
font-weight: 200;
}
</style>
Expand Down
41 changes: 41 additions & 0 deletions server/vb/templates/school.dhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% extends "base.dhtml" %}

{% block title %}
Voter Bowl
{% endblock title %}

{% block body %}
<div>
{# djlint:off #}
<style>
.background {
background-color: {{ school.logo.bg_color }};
color: {{ school.logo.bg_text_color }};
}

.action {
background-color: {{ school.logo.action_color }};
color: {{ school.logo.action_text_color }};
}
</style>
{# djlint:on #}
<style>
self {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}

self .cta {
width: 100%;
}

self .faq {
color: white;
}
</style>
<div class="cta background">Hello friends.</div>
<div class="faq">Hello</div>
</div>
{% endblock body %}

0 comments on commit 26186b0

Please sign in to comment.