Skip to content

Commit 28eb7ba

Browse files
Added new utility classes + minor typography changes
- Added new flexbox, display, vertical spacing, borders, radius, shadow and bg color utility classes; - Added option to set custom breakpoint values; - Added new shadow custom properties; - Simplified way of handling vertical spacing in typography. Co-Authored-By: Sebastiano Guerriero <sebastiano-guerriero@users.noreply.github.com>
1 parent e27120f commit 28eb7ba

15 files changed

+201
-53
lines changed

gulpfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ gulp.task('browserSync', gulp.series(function (done) {
5858
server: {
5959
baseDir: 'main'
6060
},
61+
notify: false
6162
})
6263
done();
6364
}));

main/assets/css/base/_breakpoints.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $breakpoints: (
44
md: 64rem, // ~1024px
55
lg: 80rem, // ~1280px
66
xl: 90rem // ~1440px
7-
);
7+
) !default;
88

99
@mixin breakpoint($breakpoint, $logic: false) {
1010
@if( $logic ) {

main/assets/css/base/_forms.scss

+4-17
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,17 @@
3636
}
3737

3838
// error message
39-
.form__msg-error {
40-
background-color: var(--color-error, hsl(349, 75%, 51%));
41-
color: var(--color-white, hsl(0, 0%, 100%));
39+
.form__msg-error, .form-error-msg { // .form__msg-error is fallback for older framework versions
40+
color: var(--color-error, hsl(349, 75%, 51%));
4241
font-size: var(--text-sm, 0.833em);
43-
@include fontSmooth;
44-
padding: var(--space-xs);
45-
margin-top: var(--space-sm);
46-
border-radius: var(--radius-md, 0.25em);
42+
margin-top: var(--space-xxs);
4743

4844
// hide element
4945
position: absolute;
5046
clip: rect(1px, 1px, 1px, 1px);
51-
52-
&::before {
53-
content: '';
54-
position: absolute;
55-
left: var(--space-sm);
56-
top: 0;
57-
transform: translateY(-100%);
58-
@include triangle(up, 8px, var(--color-error));
59-
}
6047
}
6148

62-
.form__msg-error--is-visible {
49+
.form__msg-error--is-visible, .form-error-msg--is-visible {
6350
position: relative;
6451
clip: auto;
6552
}

main/assets/css/base/_shared-styles.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
--radius-lg: calc(var(--radius, 0.25em)*2);
66

77
// box shadow
8+
--shadow-xs: 0 1px 2px rgba(0, 0, 0, .1); // lower depth;
89
--shadow-sm: 0 1px 2px rgba(0, 0, 0, .085), 0 1px 8px rgba(0, 0, 0, .1); // low depth;
9-
--shadow-md: 0 1px 8px rgba(0, 0, 0, .1), 0 8px 24px rgba(0, 0, 0, .15); // medium depth
10-
--shadow-lg: 0 1px 8px rgba(0, 0, 0, .1), 0 16px 48px rgba(0, 0, 0, .1), 0 24px 60px rgba(0, 0, 0, .1); // high depth
10+
--shadow-md: 0 1px 8px rgba(0, 0, 0, .085), 0 8px 24px rgba(0, 0, 0, .1); // medium depth
11+
--shadow-lg: 0 1px 8px rgba(0, 0, 0, .085), 0 16px 48px rgba(0, 0, 0, .085), 0 24px 60px rgba(0, 0, 0, .085); // high depth
12+
--shadow-xl: 0 1px 8px rgba(0, 0, 0, .085), 0 16px 64px rgba(0, 0, 0, .15), 0 24px 100px rgba(0, 0, 0, .15); // higher depth
1113

1214
// timing functions
1315
// credits: https://github.com/ai/easings.net

main/assets/css/base/_typography.scss

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:root {
22
// line-height
3-
--body-line-height: 1.4;
43
--heading-line-height: 1.2;
4+
--body-line-height: 1.4;
55
}
66

77
body {
@@ -63,24 +63,21 @@ u, .text-underline {
6363
}
6464

6565
.text-component {
66-
--component-body-line-height: calc(var(--body-line-height) * var(--line-height-multiplier, 1));
67-
--component-heading-line-height: calc(var(--heading-line-height) * var(--line-height-multiplier, 1));
68-
6966
h1, h2, h3, h4 {
70-
line-height: var(--component-heading-line-height, 1.2);
71-
margin-bottom: calc(var(--space-xxxs) * var(--text-vspace-multiplier, 1));
67+
line-height: calc(var(--heading-line-height) * var(--line-height-multiplier, 1));
68+
margin-bottom: calc(var(--space-unit) * 0.25 * var(--text-vspace-multiplier, 1));
7269
}
7370

7471
h2, h3, h4 {
75-
margin-top: calc(var(--space-sm) * var(--text-vspace-multiplier, 1));
72+
margin-top: calc(var(--space-unit) * 0.75 * var(--text-vspace-multiplier, 1));
7673
}
7774

7875
p, blockquote, ul li, ol li {
79-
line-height: var(--component-body-line-height);
76+
line-height: calc(var(--body-line-height) * var(--line-height-multiplier, 1));
8077
}
8178

8279
ul, ol, p, blockquote, .text-component__block {
83-
margin-bottom: calc(var(--space-sm) * var(--text-vspace-multiplier, 1));
80+
margin-bottom: calc(var(--space-unit) * 0.75 * var(--text-vspace-multiplier, 1));
8481
}
8582

8683
ul, ol {
@@ -102,16 +99,16 @@ u, .text-underline {
10299

103100
figcaption {
104101
text-align: center;
105-
margin-top: var(--space-xs);
102+
margin-top: calc(var(--space-unit) * 0.5);
106103
}
107104

108105
em {
109106
font-style: italic;
110107
}
111108

112109
hr {
113-
margin-top: calc(var(--space-lg) * var(--text-vspace-multiplier, 1));
114-
margin-bottom: calc(var(--space-lg) * var(--text-vspace-multiplier, 1));
110+
margin-top: calc(var(--space-unit) * 2 * var(--text-vspace-multiplier, 1));
111+
margin-bottom: calc(var(--space-unit) * 2 * var(--text-vspace-multiplier, 1));
115112
margin-left: auto;
116113
margin-right: auto;
117114
}
@@ -143,34 +140,34 @@ u, .text-underline {
143140

144141
.text-component__block--left {
145142
float: left;
146-
margin-right: calc(var(--space-sm) * var(--text-vspace-multiplier, 1));
143+
margin-right: calc(var(--space-unit) * 0.75 * var(--text-vspace-multiplier, 1));
147144
}
148145

149146
.text-component__block--right {
150147
float: right;
151-
margin-left: calc(var(--space-sm) * var(--text-vspace-multiplier, 1));
148+
margin-left: calc(var(--space-unit) * 0.75 * var(--text-vspace-multiplier, 1));
152149
}
153150
}
154151

155152
// outset content
156153
@include breakpoint(xl) {
157154
.text-component__block--outset {
158-
width: calc(100% + 2 * var(--space-xxl));
155+
width: calc(100% + 10.5 * var(--space-unit));
159156

160157
img {
161158
width: 100%;
162159
}
163160
}
164161

165162
.text-component__block--outset:not(.text-component__block--right) {
166-
margin-left: calc(-1 * var(--space-xxl));
163+
margin-left: calc(-5.25 * var(--space-unit));
167164
}
168165

169166
.text-component__block--left, .text-component__block--right {
170167
width: 50%;
171168
}
172169

173170
.text-component__block--right.text-component__block--outset {
174-
margin-right: calc(-1 * var(--space-xxl));
171+
margin-right: calc(-5.25 * var(--space-unit));
175172
}
176173
}

0 commit comments

Comments
 (0)