Skip to content

Commit 2d6a5c5

Browse files
author
Roni Laukkarinen
committed
Add option to force same line height to all headings
1 parent c0caef7 commit 2d6a5c5

File tree

6 files changed

+61
-10
lines changed

6 files changed

+61
-10
lines changed

css/layout.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* The current version of the theme.
1212
*/
13-
define( 'AIR_VERSION', '1.5.3' );
13+
define( 'AIR_VERSION', '1.5.4' );
1414

1515
/**
1616
* Allow Gravity Forms to hide labels to add placeholders

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "air",
3-
"version": "1.5.3",
3+
"version": "1.5.4",
44
"description": "A minimalist WordPress starter theme.",
55
"author": "Digitoimisto Dude Oy (moro@dude.fi)",
66
"devDependencies": {

sass/base/_config.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ $font-monospace: 'Menlo', 'Courier', monospace;
3939
// Font sizes
4040
$font-min-size: 16px; // Minimum font size, on mobile (default: 16px)
4141
$font-max-size: 21px; // Maximum font size, on desktop (default: 21px)
42+
$font-base-line-height: 1.78; // Line height for paragraphs
43+
$font-base-line-height-elements: 1.68; // Line height for other elements like table cells and spans
44+
$headings-line-height-setup: flexible; // Choose between 'flexible' and 'force', flexible values are set in _typography.scss
45+
$headings-line-height-forced: 1.5; // This is effective only if force is chosen in $headings-line-height-setup
4246

4347
// Form settings
4448
$color-button-bg: #262626;

sass/typography/_typography.scss

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,14 @@ body {
139139
@include responsive-font(4vw, 48px, 60px);
140140
letter-spacing: -.02em;
141141
font-weight: 700;
142-
line-height: 3.8rem;
142+
143+
@if $headings-line-height-setup == flexible {
144+
line-height: 3.8rem;
145+
} @else if $headings-line-height-setup == force {
146+
line-height: $headings-line-height-forced;
147+
} @else {
148+
line-height: $headings-line-height-forced;
149+
}
143150

144151
&:first-child {
145152
margin-top: 0;
@@ -149,7 +156,14 @@ body {
149156
h2 {
150157
@include responsive-font(3.2vw, 36px, 48px);
151158
letter-spacing: -.02em;
152-
line-height: 3.2rem;
159+
160+
@if $headings-line-height-setup == flexible {
161+
line-height: 3.2rem;
162+
} @else if $headings-line-height-setup == force {
163+
line-height: $headings-line-height-forced;
164+
} @else {
165+
line-height: $headings-line-height-forced;
166+
}
153167

154168
&:first-child {
155169
margin-top: 0;
@@ -160,12 +174,30 @@ body {
160174
.gform_wrapper h3.gform_title {
161175
@include responsive-font(2.4vw, 24px, 36px);
162176
letter-spacing: -.02em;
163-
line-height: 2.2rem;
177+
178+
@if $headings-line-height-setup == flexible {
179+
line-height: 2.2rem;
180+
} @else if $headings-line-height-setup == force {
181+
line-height: $headings-line-height-forced;
182+
} @else {
183+
line-height: $headings-line-height-forced;
184+
}
185+
186+
&:first-child {
187+
margin-top: 0;
188+
}
164189
}
165190

166191
h4 {
167192
@include responsive-font(1.6vw, 21px, 24px);
168-
line-height: 1.4rem;
193+
194+
@if $headings-line-height-setup == flexible {
195+
line-height: 1.4rem;
196+
} @else if $headings-line-height-setup == force {
197+
line-height: $headings-line-height-forced;
198+
} @else {
199+
line-height: $headings-line-height-forced;
200+
}
169201

170202
&:first-child {
171203
margin-top: 0;
@@ -174,7 +206,14 @@ body {
174206

175207
h5 {
176208
@include responsive-font(1.4vw, 18px, 21px);
177-
line-height: 1.2rem;
209+
210+
@if $headings-line-height-setup == flexible {
211+
line-height: 1.2rem;
212+
} @else if $headings-line-height-setup == force {
213+
line-height: $headings-line-height-forced;
214+
} @else {
215+
line-height: $headings-line-height-forced;
216+
}
178217

179218
&:first-child {
180219
margin-top: 0;
@@ -183,7 +222,15 @@ body {
183222

184223
h6 {
185224
@include responsive-font(1.2vw, 14px, 18px);
186-
line-height: 1rem;
225+
226+
227+
@if $headings-line-height-setup == flexible {
228+
line-height: 1rem;
229+
} @else if $headings-line-height-setup == force {
230+
line-height: $headings-line-height-forced;
231+
} @else {
232+
line-height: $headings-line-height-forced;
233+
}
187234

188235
&:first-child {
189236
margin-top: 0;

style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Theme URI: https://github.com/digitoimistodude/air
44
Author: Digitoimisto Dude Oy
55
Author URI: https://www.dude.fi
66
Description: A minimalist WordPress starter theme.
7-
Version: 1.5.3
7+
Version: 1.5.4
88
License: GNU General Public License v2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010
Text Domain: air

0 commit comments

Comments
 (0)