Skip to content

Commit

Permalink
[Header] add setting to tweak top and bottom padding (#1654)
Browse files Browse the repository at this point in the history
* Add header padding setting

* Update minimum to 5

* Changed defaults

* Update header with option 2

* Remove unnecessary code
  • Loading branch information
LucasLacerdaUX authored May 11, 2022
1 parent 2d5a857 commit 984e244
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
11 changes: 0 additions & 11 deletions assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -2226,20 +2226,9 @@ input[type='checkbox'] {
grid-template-areas: 'left-icon heading icons';
grid-template-columns: 1fr 2fr 1fr;
align-items: center;
padding-top: 1rem;
padding-bottom: 1rem;
}

@media screen and (min-width: 990px) {
.header {
padding-top: 2rem;
padding-bottom: 2rem;
}

.header--has-menu:not(.header--middle-left) {
padding-bottom: 0;
}

.header--top-left,
.header--middle-left:not(.header--has-menu) {
grid-template-areas:
Expand Down
36 changes: 36 additions & 0 deletions sections/header.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
</style>

{%- style -%}
.header {
padding-top: {{ section.settings.padding_top | times: 0.5 | round: 0 }}px;
padding-bottom: {{ section.settings.padding_bottom | times: 0.5 | round: 0 }}px;
}

.section-header {
margin-bottom: {{ section.settings.margin_bottom | times: 0.75 | round: 0 }}px;
}
Expand All @@ -88,6 +93,13 @@
margin-bottom: {{ section.settings.margin_bottom }}px;
}
}

@media screen and (min-width: 990px) {
.header {
padding-top: {{ section.settings.padding_top }}px;
padding-bottom: {{ section.settings.padding_bottom }}px;
}
}
{%- endstyle -%}

<script src="{{ 'details-disclosure.js' | asset_url }}" defer="defer"></script>
Expand Down Expand Up @@ -839,6 +851,30 @@
"unit": "px",
"label": "t:sections.header.settings.margin_bottom.label",
"default": 0
},
{
"type": "header",
"content": "t:sections.all.padding.section_padding_heading"
},
{
"type": "range",
"id": "padding_top",
"min": 4,
"max": 36,
"step": 4,
"unit": "px",
"label": "t:sections.all.padding.padding_top",
"default": 20
},
{
"type": "range",
"id": "padding_bottom",
"min": 4,
"max": 36,
"step": 4,
"unit": "px",
"label": "t:sections.all.padding.padding_bottom",
"default": 20
}
]
}
Expand Down

0 comments on commit 984e244

Please sign in to comment.