@ndla/preset-panda 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/styles.css +35 -30
- package/es/globalCss.js +44 -32
- package/es/index.js +1 -0
- package/lib/globalCss.js +44 -32
- package/lib/index.js +1 -0
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
html {
|
|
11
11
|
min-height: 100%;
|
|
12
|
+
font-feature-settings: 'ss03' on, 'liga' off, 'clig' off;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
body {
|
|
@@ -37,84 +38,88 @@
|
|
|
37
38
|
display: none;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
margin: 48px 0 12px 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
h3:not([class]),h4:not([class]),h5:not([class]) {
|
|
49
|
-
margin: 36px 0 6px 0;
|
|
41
|
+
.ndla-article {
|
|
42
|
+
font-family: var(--fonts-serif);
|
|
43
|
+
font-weight: var(--font-weights-normal);
|
|
44
|
+
font-size: var(--font-sizes-medium);
|
|
45
|
+
line-height: var(--line-heights-medium);
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
.ndla-article:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
49
|
+
font-size: calc(var(--font-sizes-medium) * 1.11);
|
|
50
|
+
line-height: calc(var(--line-heights-medium) * 1.11);
|
|
54
51
|
}
|
|
55
52
|
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
.ndla-article {
|
|
54
|
+
width: 100%;
|
|
58
55
|
}
|
|
59
56
|
|
|
60
|
-
h1 {
|
|
57
|
+
.ndla-article h1 {
|
|
61
58
|
font-family: var(--fonts-sans);
|
|
62
59
|
font-weight: var(--font-weights-bold);
|
|
63
60
|
font-size: var(--font-sizes-3xlarge);
|
|
64
61
|
line-height: var(--line-heights-3xlarge);
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
h1:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
64
|
+
.ndla-article h1:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
68
65
|
font-size: calc(var(--font-sizes-3xlarge) * 1.11);
|
|
69
66
|
line-height: calc(var(--line-heights-3xlarge) * 1.11);
|
|
70
67
|
}
|
|
71
68
|
|
|
72
|
-
h2 {
|
|
69
|
+
.ndla-article h2 {
|
|
73
70
|
font-family: var(--fonts-sans);
|
|
74
71
|
font-weight: var(--font-weights-bold);
|
|
75
72
|
font-size: var(--font-sizes-xxlarge);
|
|
76
73
|
line-height: var(--line-heights-xxlarge);
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
h2:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
76
|
+
.ndla-article h2:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
80
77
|
font-size: calc(var(--font-sizes-xxlarge) * 1.11);
|
|
81
78
|
line-height: calc(var(--line-heights-xxlarge) * 1.11);
|
|
82
79
|
}
|
|
83
80
|
|
|
84
|
-
h3 {
|
|
81
|
+
.ndla-article h3 {
|
|
85
82
|
font-family: var(--fonts-sans);
|
|
86
83
|
font-weight: var(--font-weights-bold);
|
|
87
84
|
font-size: var(--font-sizes-xlarge);
|
|
88
85
|
line-height: var(--line-heights-xlarge);
|
|
89
86
|
}
|
|
90
87
|
|
|
91
|
-
h3:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
88
|
+
.ndla-article h3:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
92
89
|
font-size: calc(var(--font-sizes-xlarge) * 1.11);
|
|
93
90
|
line-height: calc(var(--line-heights-xlarge) * 1.11);
|
|
94
91
|
}
|
|
95
92
|
|
|
96
|
-
h4
|
|
93
|
+
.ndla-article h4,.ndla-article h5,.ndla-article h6 {
|
|
97
94
|
font-family: var(--fonts-sans);
|
|
98
95
|
font-weight: var(--font-weights-bold);
|
|
99
96
|
font-size: var(--font-sizes-large);
|
|
100
97
|
line-height: var(--line-heights-large);
|
|
101
98
|
}
|
|
102
99
|
|
|
103
|
-
h4:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin])
|
|
100
|
+
.ndla-article h4:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]),.ndla-article h5:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]),.ndla-article h6:where([lang='zh'], [lang='zh-Hans'], [lang='zh-Hant']):not([data-pinyin]) {
|
|
104
101
|
font-size: calc(var(--font-sizes-large) * 1.11);
|
|
105
102
|
line-height: calc(var(--line-heights-large) * 1.11);
|
|
106
103
|
}
|
|
107
104
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
.ndla-article details,.ndla-article blockquote,.ndla-article [data-embed-type="framed-content"],.ndla-article [data-embed-type="factbox"],.ndla-article table,.ndla-article [data-embed-type="related-content-list"],.ndla-article [data-embed-type="link-block-list"],.ndla-article [data-embed-type="blog-post"],.ndla-article [data-embed-type="campaign-block"],.ndla-article [data-embed-type="key-figure"],.ndla-article [data-embed-type="grid"],.ndla-article [data-embed-type="contact-block"],.ndla-article [data-embed-type="file-list"],.ndla-article [data-embed-type="uu-disclaimer"] {
|
|
106
|
+
margin-block-start: var(--spacing-xsmall);
|
|
107
|
+
margin-block-end: var(--spacing-xsmall);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ndla-article section:not([class]) > :is(h2, [data-embed-type="copy-heading"]),.ndla-article section:not([class]) > div:not([class]) > :is(h2, [data-embed-type="copy-heading"]),.ndla-article [data-embed-type="framed-content"] > :is(h2, [data-embed-type="copy-heading"]),.ndla-article [data-embed-type="grid"] > div > :is(h2, [data-embed-type="copy-heading"]),.ndla-article [data-embed-type="grid-parallax"] > div > :is(h2, [data-embed-type="copy-heading"]),.ndla-article [data-embed-type="factbox"] > div > :is(h2, [data-embed-type="copy-heading"]),.ndla-article [data-embed-type="copyright"] > :is(h2, [data-embed-type="copy-heading"]),.ndla-article [data-embed-type="uu-disclaimer"] > :is(h2, [data-embed-type="copy-heading"]),.ndla-article details > :is(h2, [data-embed-type="copy-heading"]),.ndla-article blockquote > :is(h2, [data-embed-type="copy-heading"]) {
|
|
111
|
+
margin-block-start: var(--spacing-medium);
|
|
112
|
+
margin-block-end: var(--spacing-medium);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ndla-article section:not([class]) > h3,.ndla-article section:not([class]) > div:not([class]) > h3,.ndla-article [data-embed-type="framed-content"] > h3,.ndla-article [data-embed-type="grid"] > div > h3,.ndla-article [data-embed-type="grid-parallax"] > div > h3,.ndla-article [data-embed-type="factbox"] > div > h3,.ndla-article [data-embed-type="copyright"] > h3,.ndla-article [data-embed-type="uu-disclaimer"] > h3,.ndla-article details > h3,.ndla-article blockquote > h3 {
|
|
116
|
+
margin-block-start: var(--spacing-small);
|
|
117
|
+
margin-block-end: var(--spacing-small);
|
|
113
118
|
}
|
|
114
119
|
|
|
115
|
-
p:
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
.ndla-article section:not([class]) > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article section:not([class]) > div:not([class]) > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article [data-embed-type="framed-content"] > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article [data-embed-type="grid"] > div > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article [data-embed-type="grid-parallax"] > div > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article [data-embed-type="factbox"] > div > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article [data-embed-type="copyright"] > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article [data-embed-type="uu-disclaimer"] > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article details > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]),.ndla-article blockquote > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"]) {
|
|
121
|
+
margin-block-start: var(--spacing-xsmall);
|
|
122
|
+
margin-block-end: var(--spacing-xsmall);
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
a:not([class]):not([data-unstyled]),a[class=""]:not([data-unstyled]) {
|
package/es/globalCss.js
CHANGED
|
@@ -15,7 +15,8 @@ export const globalCss = defineGlobalStyles({
|
|
|
15
15
|
"--global-font-mono": "fonts.code"
|
|
16
16
|
},
|
|
17
17
|
html: {
|
|
18
|
-
minHeight: "100%"
|
|
18
|
+
minHeight: "100%",
|
|
19
|
+
fontFeatureSettings: "'ss03' on, 'liga' off, 'clig' off"
|
|
19
20
|
},
|
|
20
21
|
body: {
|
|
21
22
|
background: "background.default"
|
|
@@ -38,38 +39,49 @@ export const globalCss = defineGlobalStyles({
|
|
|
38
39
|
"iframe#launcher": {
|
|
39
40
|
display: "none"
|
|
40
41
|
},
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
42
|
+
// For future readers: Life here would be much simpler if we could use flex.
|
|
43
|
+
// However, our usage of float within the article content forces us to use margins.
|
|
44
|
+
".ndla-article": {
|
|
45
|
+
h1: {
|
|
46
|
+
textStyle: "heading.medium"
|
|
47
|
+
},
|
|
48
|
+
h2: {
|
|
49
|
+
textStyle: "heading.small"
|
|
50
|
+
},
|
|
51
|
+
h3: {
|
|
52
|
+
textStyle: "title.large"
|
|
53
|
+
},
|
|
54
|
+
"h4, h5, h6": {
|
|
55
|
+
textStyle: "title.medium"
|
|
56
|
+
},
|
|
57
|
+
textStyle: "body.article",
|
|
58
|
+
width: "100%",
|
|
59
|
+
// TODO: Re-check all margin values here. Especially headings.
|
|
60
|
+
// TODO: Reconsider grid margins. Do we want custom handling for items inside a grid?
|
|
61
|
+
|
|
62
|
+
// Non-figure block elements that should have margin above and below.
|
|
63
|
+
'& details, blockquote, [data-embed-type="framed-content"], [data-embed-type="factbox"], table, [data-embed-type="related-content-list"], [data-embed-type="link-block-list"], [data-embed-type="blog-post"], [data-embed-type="campaign-block"], [data-embed-type="key-figure"], [data-embed-type="grid"], [data-embed-type="contact-block"], [data-embed-type="file-list"], [data-embed-type="uu-disclaimer"]': {
|
|
64
|
+
marginBlockStart: "xsmall",
|
|
65
|
+
marginBlockEnd: "xsmall"
|
|
66
|
+
},
|
|
67
|
+
// Article content is usually wrapped in a section. The rest of the elements in this list contains other elements, and should add margin to them no matter where they are placed in the DOM.
|
|
68
|
+
'& section:not([class]), section:not([class]) > div:not([class]), [data-embed-type="framed-content"], [data-embed-type="grid"] > div, [data-embed-type="grid-parallax"] > div, [data-embed-type="factbox"] > div, [data-embed-type="copyright"], [data-embed-type="uu-disclaimer"], details, blockquote': {
|
|
69
|
+
// TODO: Remove copy-heading if we can merge the new heading links
|
|
70
|
+
'& > :is(h2, [data-embed-type="copy-heading"])': {
|
|
71
|
+
marginBlockStart: "medium",
|
|
72
|
+
marginBlockEnd: "medium"
|
|
73
|
+
},
|
|
74
|
+
"& > h3": {
|
|
75
|
+
marginBlockStart: "small",
|
|
76
|
+
marginBlockEnd: "small"
|
|
77
|
+
},
|
|
78
|
+
'& > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"])': {
|
|
79
|
+
marginBlockStart: "xsmall",
|
|
80
|
+
marginBlockEnd: "xsmall"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
72
83
|
},
|
|
84
|
+
// Adds default link styling to links without classes
|
|
73
85
|
'a:not([class]):not([data-unstyled]), a[class=""]:not([data-unstyled])': {
|
|
74
86
|
color: "text.link",
|
|
75
87
|
textDecoration: "underline",
|
package/es/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { spacing } from "./spacing";
|
|
|
19
19
|
import { fontWeights, textStyles, fonts, fontSizes, lineHeights } from "./typography";
|
|
20
20
|
import { zIndex } from "./zIndex";
|
|
21
21
|
const preset = definePreset({
|
|
22
|
+
name: "ndla/panda",
|
|
22
23
|
globalCss: globalCss,
|
|
23
24
|
conditions: conditions,
|
|
24
25
|
theme: {
|
package/lib/globalCss.js
CHANGED
|
@@ -21,7 +21,8 @@ const globalCss = exports.globalCss = (0, _dev.defineGlobalStyles)({
|
|
|
21
21
|
"--global-font-mono": "fonts.code"
|
|
22
22
|
},
|
|
23
23
|
html: {
|
|
24
|
-
minHeight: "100%"
|
|
24
|
+
minHeight: "100%",
|
|
25
|
+
fontFeatureSettings: "'ss03' on, 'liga' off, 'clig' off"
|
|
25
26
|
},
|
|
26
27
|
body: {
|
|
27
28
|
background: "background.default"
|
|
@@ -44,38 +45,49 @@ const globalCss = exports.globalCss = (0, _dev.defineGlobalStyles)({
|
|
|
44
45
|
"iframe#launcher": {
|
|
45
46
|
display: "none"
|
|
46
47
|
},
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
48
|
+
// For future readers: Life here would be much simpler if we could use flex.
|
|
49
|
+
// However, our usage of float within the article content forces us to use margins.
|
|
50
|
+
".ndla-article": {
|
|
51
|
+
h1: {
|
|
52
|
+
textStyle: "heading.medium"
|
|
53
|
+
},
|
|
54
|
+
h2: {
|
|
55
|
+
textStyle: "heading.small"
|
|
56
|
+
},
|
|
57
|
+
h3: {
|
|
58
|
+
textStyle: "title.large"
|
|
59
|
+
},
|
|
60
|
+
"h4, h5, h6": {
|
|
61
|
+
textStyle: "title.medium"
|
|
62
|
+
},
|
|
63
|
+
textStyle: "body.article",
|
|
64
|
+
width: "100%",
|
|
65
|
+
// TODO: Re-check all margin values here. Especially headings.
|
|
66
|
+
// TODO: Reconsider grid margins. Do we want custom handling for items inside a grid?
|
|
67
|
+
|
|
68
|
+
// Non-figure block elements that should have margin above and below.
|
|
69
|
+
'& details, blockquote, [data-embed-type="framed-content"], [data-embed-type="factbox"], table, [data-embed-type="related-content-list"], [data-embed-type="link-block-list"], [data-embed-type="blog-post"], [data-embed-type="campaign-block"], [data-embed-type="key-figure"], [data-embed-type="grid"], [data-embed-type="contact-block"], [data-embed-type="file-list"], [data-embed-type="uu-disclaimer"]': {
|
|
70
|
+
marginBlockStart: "xsmall",
|
|
71
|
+
marginBlockEnd: "xsmall"
|
|
72
|
+
},
|
|
73
|
+
// Article content is usually wrapped in a section. The rest of the elements in this list contains other elements, and should add margin to them no matter where they are placed in the DOM.
|
|
74
|
+
'& section:not([class]), section:not([class]) > div:not([class]), [data-embed-type="framed-content"], [data-embed-type="grid"] > div, [data-embed-type="grid-parallax"] > div, [data-embed-type="factbox"] > div, [data-embed-type="copyright"], [data-embed-type="uu-disclaimer"], details, blockquote': {
|
|
75
|
+
// TODO: Remove copy-heading if we can merge the new heading links
|
|
76
|
+
'& > :is(h2, [data-embed-type="copy-heading"])': {
|
|
77
|
+
marginBlockStart: "medium",
|
|
78
|
+
marginBlockEnd: "medium"
|
|
79
|
+
},
|
|
80
|
+
"& > h3": {
|
|
81
|
+
marginBlockStart: "small",
|
|
82
|
+
marginBlockEnd: "small"
|
|
83
|
+
},
|
|
84
|
+
'& > :is(p, h4, h5, h6, figure, ul, ol, dl, [data-embed-type="speech"])': {
|
|
85
|
+
marginBlockStart: "xsmall",
|
|
86
|
+
marginBlockEnd: "xsmall"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
78
89
|
},
|
|
90
|
+
// Adds default link styling to links without classes
|
|
79
91
|
'a:not([class]):not([data-unstyled]), a[class=""]:not([data-unstyled])': {
|
|
80
92
|
color: "text.link",
|
|
81
93
|
textDecoration: "underline",
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/preset-panda",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Panda preset for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"lib"
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@pandacss/dev": "^0.
|
|
34
|
+
"@pandacss/dev": "^0.44.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "0fdd094fea36baa5ee2bdfe5b2bc6c423d304f22"
|
|
40
40
|
}
|