summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package.json2
-rw-r--r--src/objects/_heading.scss29
-rw-r--r--src/scopes/_headings.scss29
-rw-r--r--tpl/objects/heading.pug40
-rw-r--r--tpl/views/heading.pug20
5 files changed, 71 insertions, 49 deletions
diff --git a/package.json b/package.json
index 33d0a79..a278393 100644
--- a/package.json
+++ b/package.json
@@ -15,7 +15,7 @@
15 "build:style": "sass --load-path=node_modules src_demo/index.scss public/style.css", 15 "build:style": "sass --load-path=node_modules src_demo/index.scss public/style.css",
16 "lint:style": "stylelint \"src/**/*.scss\"", 16 "lint:style": "stylelint \"src/**/*.scss\"",
17 "fix:style": "stylelint \"src/**/*.scss\" --fix", 17 "fix:style": "stylelint \"src/**/*.scss\" --fix",
18 "serve": "python -m http.server --bind 127.0.0.1 --directory public 8000" 18 "serve": "python -m http.server --bind 127.0.0.1 --directory public 8001"
19 }, 19 },
20 "dependencies": { 20 "dependencies": {
21 "@oddbird/blend": "^0.2.3", 21 "@oddbird/blend": "^0.2.3",
diff --git a/src/objects/_heading.scss b/src/objects/_heading.scss
index 6264072..56d4987 100644
--- a/src/objects/_heading.scss
+++ b/src/objects/_heading.scss
@@ -27,17 +27,17 @@
27 27
28 @include iro.bem-modifier('xxl') { 28 @include iro.bem-modifier('xxl') {
29 color: fn.color(--strong); 29 color: fn.color(--strong);
30 font-size: fn.global-dim(--font-size --900); 30 font-size: fn.global-dim(--font-size --400);
31 } 31 }
32 32
33 @include iro.bem-modifier('xl') { 33 @include iro.bem-modifier('xl') {
34 color: fn.color(--strong); 34 color: fn.color(--strong);
35 font-size: fn.global-dim(--font-size --600); 35 font-size: fn.global-dim(--font-size --300);
36 } 36 }
37 37
38 @include iro.bem-modifier('lg') { 38 @include iro.bem-modifier('lg') {
39 color: fn.color(--strong); 39 color: fn.color(--strong);
40 font-size: fn.global-dim(--font-size --300); 40 font-size: fn.global-dim(--font-size --200);
41 } 41 }
42 42
43 @include iro.bem-modifier('md') { 43 @include iro.bem-modifier('md') {
@@ -71,14 +71,21 @@
71 color: fn.color(--light); 71 color: fn.color(--light);
72 } 72 }
73 73
74 @include iro.bem-elem('primary') { 74 @include iro.bem-modifier('display') {
75 background-image: linear-gradient( 75 @include iro.bem-modifier('xxl') {
76 to top, 76 color: fn.foreign-color(--heading, --strong);
77 transparent .15em, 77 font-size: fn.global-dim(--font-size --900);
78 fn.color(--bg) .15em, 78 }
79 fn.color(--bg) .6em, 79
80 transparent .6em 80 @include iro.bem-modifier('xl') {
81 ); 81 color: fn.foreign-color(--heading, --strong);
82 font-size: fn.global-dim(--font-size --600);
83 }
84
85 @include iro.bem-modifier('l') {
86 color: fn.foreign-color(--heading, --strong);
87 font-size: fn.global-dim(--font-size --300);
88 }
82 } 89 }
83 } 90 }
84} 91}
diff --git a/src/scopes/_headings.scss b/src/scopes/_headings.scss
index 58bac7f..fc4991a 100644
--- a/src/scopes/_headings.scss
+++ b/src/scopes/_headings.scss
@@ -21,17 +21,17 @@
21 21
22 h1 { 22 h1 {
23 color: fn.foreign-color(--heading, --strong); 23 color: fn.foreign-color(--heading, --strong);
24 font-size: fn.global-dim(--font-size --900); 24 font-size: fn.global-dim(--font-size --400);
25 } 25 }
26 26
27 h2 { 27 h2 {
28 color: fn.foreign-color(--heading, --strong); 28 color: fn.foreign-color(--heading, --strong);
29 font-size: fn.global-dim(--font-size --600); 29 font-size: fn.global-dim(--font-size --300);
30 } 30 }
31 31
32 h3 { 32 h3 {
33 color: fn.foreign-color(--heading, --strong); 33 color: fn.foreign-color(--heading, --strong);
34 font-size: fn.global-dim(--font-size --300); 34 font-size: fn.global-dim(--font-size --200);
35 } 35 }
36 36
37 h4 { 37 h4 {
@@ -65,14 +65,21 @@
65 color: fn.foreign-color(--heading, --light); 65 color: fn.foreign-color(--heading, --light);
66 } 66 }
67 67
68 @include iro.bem-elem('primary') { 68 @include iro.bem-modifier('display') {
69 background-image: linear-gradient( 69 h1 {
70 to top, 70 color: fn.foreign-color(--heading, --strong);
71 transparent .15em, 71 font-size: fn.global-dim(--font-size --900);
72 fn.foreign-color(--heading, --bg) .15em, 72 }
73 fn.foreign-color(--heading, --bg) .6em, 73
74 transparent .6em 74 h2 {
75 ); 75 color: fn.foreign-color(--heading, --strong);
76 font-size: fn.global-dim(--font-size --600);
77 }
78
79 h3 {
80 color: fn.foreign-color(--heading, --strong);
81 font-size: fn.global-dim(--font-size --300);
82 }
76 } 83 }
77 } 84 }
78} 85}
diff --git a/tpl/objects/heading.pug b/tpl/objects/heading.pug
index 47ffefa..6cc05ad 100644
--- a/tpl/objects/heading.pug
+++ b/tpl/objects/heading.pug
@@ -1,42 +1,34 @@
1mixin h1-heading(level, inner = false) 1mixin h1-heading(level, display = false)
2 - let classes = ['o-heading', 'o-heading--' + level] 2 - let classes = ['o-heading', 'o-heading--' + level, { 'o-heading--display': display }]
3 h1(class=classes)&attributes(attributes) 3 h1(class=classes)&attributes(attributes)
4 if inner 4 block
5 span.o-heading__inner
6 block
7 else
8 block
9 5
10mixin h2-heading(level) 6mixin h2-heading(level, display = false)
11 - let classes = ['o-heading', 'o-heading--' + level] 7 - let classes = ['o-heading', 'o-heading--' + level, { 'o-heading--display': display }]
12 h2(class=classes)&attributes(attributes) 8 h2(class=classes)&attributes(attributes)
13 block 9 block
14 10
15mixin h3-heading(level) 11mixin h3-heading(level, display = false)
16 - let classes = ['o-heading', 'o-heading--' + level] 12 - let classes = ['o-heading', 'o-heading--' + level, { 'o-heading--display': display }]
17 h3(class=classes)&attributes(attributes) 13 h3(class=classes)&attributes(attributes)
18 block 14 block
19 15
20mixin h4-heading(level) 16mixin h4-heading(level, display = false)
21 - let classes = ['o-heading', 'o-heading--' + level] 17 - let classes = ['o-heading', 'o-heading--' + level, { 'o-heading--display': display }]
22 h4(class=classes)&attributes(attributes) 18 h4(class=classes)&attributes(attributes)
23 block 19 block
24 20
25mixin h5-heading(level) 21mixin h5-heading(level, display = false)
26 - let classes = ['o-heading', 'o-heading--' + level] 22 - let classes = ['o-heading', 'o-heading--' + level, { 'o-heading--display': display }]
27 h5(class=classes)&attributes(attributes) 23 h5(class=classes)&attributes(attributes)
28 block 24 block
29 25
30mixin h6-heading(level) 26mixin h6-heading(level, display = false)
31 - let classes = ['o-heading', 'o-heading--' + level] 27 - let classes = ['o-heading', 'o-heading--' + level, { 'o-heading--display': display }]
32 h6(class=classes)&attributes(attributes) 28 h6(class=classes)&attributes(attributes)
33 block 29 block
34 30
35mixin div-heading(level, primary = false) 31mixin div-heading(level, display = false)
36 - let classes = ['o-heading', 'o-heading--' + level] 32 - let classes = ['o-heading', 'o-heading--' + level, { 'o-heading--display': display }]
37 div(class=classes)&attributes(attributes) 33 div(class=classes)&attributes(attributes)
38 if primary 34 block
39 span.o-heading__primary
40 block
41 else
42 block
diff --git a/tpl/views/heading.pug b/tpl/views/heading.pug
index 07080d5..bc16cee 100644
--- a/tpl/views/heading.pug
+++ b/tpl/views/heading.pug
@@ -9,17 +9,33 @@ mixin view-heading
9 h6= 'H6 default' 9 h6= 'H6 default'
10 10
11 .c-box.s-headings 11 .c-box.s-headings
12 h1.u-mt-0: span.s-headings__primary= 'H1 styled' 12 h1.u-mt-0= 'H1 styled'
13 h2= 'H2 styled' 13 h2= 'H2 styled'
14 h3= 'H3 styled' 14 h3= 'H3 styled'
15 h4= 'H4 styled' 15 h4= 'H4 styled'
16 h5= 'H5 styled' 16 h5= 'H5 styled'
17 h6= 'H6 styled' 17 h6= 'H6 styled'
18 18
19 .c-box.s-headings.s-headings--display
20 h1.u-mt-0= 'H1 display styled'
21 h2= 'H2 display styled'
22 h3= 'H3 display styled'
23 h4= 'H4 display styled'
24 h5= 'H5 display styled'
25 h6= 'H6 display styled'
26
19 .c-box 27 .c-box
20 +div-heading('xxl', true)(class='u-mt-0')= 'XXL Heading' 28 +div-heading('xxl')(class='u-mt-0')= 'XXL Heading'
21 +div-heading('xl')= 'XL Heading' 29 +div-heading('xl')= 'XL Heading'
22 +div-heading('lg')= 'LG Heading' 30 +div-heading('lg')= 'LG Heading'
23 +div-heading('md')= 'MD Heading' 31 +div-heading('md')= 'MD Heading'
24 +div-heading('sm')= 'SM Heading' 32 +div-heading('sm')= 'SM Heading'
25 +div-heading('xs')= 'XS Heading' 33 +div-heading('xs')= 'XS Heading'
34
35 .c-box
36 +div-heading('xxl', true)(class='u-mt-0')= 'XXL display Heading'
37 +div-heading('xl', true)= 'XL display Heading'
38 +div-heading('lg', true)= 'LG display Heading'
39 +div-heading('md', true)= 'MD display Heading'
40 +div-heading('sm', true)= 'SM display Heading'
41 +div-heading('xs', true)= 'XS display Heading'