aliascss 1.4.4 → 1.4.7
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/aliascss.config.js +32 -32
- package/dist/aliascss.js +1 -1
- package/lib/compilers/color.js +5 -5
- package/lib/compilers/gradient.js +3 -3
- package/lib/compilers/stringAndContent.js +2 -1
- package/lib/component-elements.d.ts +155 -0
- package/lib/component-elements.js +223 -0
- package/lib/config.d.ts +1 -0
- package/lib/config.js +2 -1
- package/lib/css-properties-all.js +337 -202
- package/lib/custom-css-compilers.js +54 -54
- package/lib/extras-elements.d.ts +87 -0
- package/lib/extras-elements.js +184 -0
- package/lib/form-elements.d.ts +75 -0
- package/lib/form-elements.js +186 -0
- package/lib/layout-elements.d.ts +59 -0
- package/lib/layout-elements.js +113 -0
- package/lib/nav-elements.d.ts +71 -0
- package/lib/nav-elements.js +243 -0
- package/lib/node/compileFile-bk.d.ts +27 -0
- package/lib/node/compileFile-bk.js +379 -0
- package/lib/node/compileFile.d.ts +11 -11
- package/lib/node/compileFile.js +170 -235
- package/lib/prebuild.d.ts +520 -12
- package/lib/prebuild.js +9 -852
- package/lib/prefix/PseudoPrefixNew.js +301 -16
- package/lib/prefix/attribute-selector.js +4 -2
- package/lib/prefix/pseudoSelectorNew.js +184 -49
- package/lib/prefix/responsive.d.ts +13 -9
- package/lib/prefix/responsive.js +131 -9
- package/lib/returnPropertyAndValue.js +9 -4
- package/lib/returnStatement-bk.d.ts +5 -0
- package/lib/returnStatement-bk.js +311 -0
- package/lib/returnStatement.js +165 -2
- package/lib/static/customStaticClassNames.js +35 -35
- package/lib/static/staticClassNamesAlias.js +18 -16
- package/lib/table-elements.d.ts +39 -0
- package/lib/table-elements.js +90 -0
- package/lib/utils/helper.d.ts +6 -0
- package/lib/utils/helper.js +52 -0
- package/lib/x-classes/x-bundle.d.ts +563 -0
- package/lib/x-classes/x-bundle.js +11 -0
- package/lib/x-classes/x-comps.d.ts +87 -0
- package/lib/x-classes/x-comps.js +189 -0
- package/lib/x-classes/x-extras.d.ts +155 -0
- package/lib/x-classes/x-extras.js +223 -0
- package/lib/x-classes/x-form-components.d.ts +75 -0
- package/lib/x-classes/x-form-components.js +186 -0
- package/lib/x-classes/x-helper-components.d.ts +63 -0
- package/lib/x-classes/x-helper-components.js +91 -0
- package/lib/x-classes/x-layout-components.d.ts +59 -0
- package/lib/x-classes/x-layout-components.js +113 -0
- package/lib/x-classes/x-menu.d.ts +23 -0
- package/lib/x-classes/x-menu.js +55 -0
- package/lib/x-classes/x-navs.d.ts +71 -0
- package/lib/x-classes/x-navs.js +243 -0
- package/lib/x-classes/x-table.d.ts +39 -0
- package/lib/x-classes/x-table.js +90 -0
- package/lib/x-classes/x-theme.d.ts +15 -0
- package/lib/x-classes/x-theme.js +32 -0
- package/lib/x-imports.d.ts +31 -0
- package/lib/x-imports.js +748 -0
- package/package.json +1 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// AliasCSS form components
|
|
2
|
+
// ------------------------------------------------------------------
|
|
3
|
+
// Paste the entries into your prebuilt statements object.
|
|
4
|
+
//
|
|
5
|
+
// Design:
|
|
6
|
+
// - Resets live in @base, styles in @components, so any plain utility
|
|
7
|
+
// class (unlayered) on the element always overrides them.
|
|
8
|
+
// - Everything is themeable through CSS variables with token fallbacks.
|
|
9
|
+
// Set them once on :root (or a wrapper / dark-mode block) to re-theme
|
|
10
|
+
// every control; set them on one element to change just that element.
|
|
11
|
+
//
|
|
12
|
+
// Shared variables (all optional):
|
|
13
|
+
// --x-form-height control height (40px)
|
|
14
|
+
// --x-form-radius corner radius (8px)
|
|
15
|
+
// --x-form-font-size input text size (16px, avoids iOS zoom)
|
|
16
|
+
// --x-form-bg control background (white)
|
|
17
|
+
// --x-form-color text color (gray900)
|
|
18
|
+
// --x-form-border-color border (gray300)
|
|
19
|
+
// --x-form-border-hover-color (gray400)
|
|
20
|
+
// --x-form-placeholder-color (gray400)
|
|
21
|
+
// --x-form-accent-color focus / checked / primary (primary600)
|
|
22
|
+
// --x-form-ring-color focus ring (primary600/0.2)
|
|
23
|
+
// --x-form-error-color invalid state (error600)
|
|
24
|
+
// --x-form-error-ring-color (error600/0.2)
|
|
25
|
+
// --x-form-disabled-bg / --x-form-disabled-color (gray50 / gray500)
|
|
26
|
+
// --x-form-label-color / --x-form-hint-color (gray700 / gray500)
|
|
27
|
+
// ------------------------------------------------------------------
|
|
28
|
+
const focusVisible = `@components--focus-visible[outline-style-solid,outline-width-2px,outline-color--x-form-accent-color:primary600,outline-offset-2px]`;
|
|
29
|
+
// Shared text-field styles (x-input, x-textarea, x-select)
|
|
30
|
+
const field = `
|
|
31
|
+
@base-all-unset
|
|
32
|
+
@components[d-block,w-100%,h--x-form-height:40px,p-0px-12px,box-sizing-border-box,br--x-form-radius:8px,border-width-1px,border-style-solid,border-color--x-form-border-color:gray300,bgc--x-form-bg:white,c--x-form-color:gray900,fs--x-form-font-size:16px,lh-1.5,cursor-text,transition-property-border-color__box-shadow,transition-duration-0.15s]
|
|
33
|
+
--ring-width:3px
|
|
34
|
+
@components--placeholder-c--x-form-placeholder-color:gray400
|
|
35
|
+
@components--enabled--hover-border-color--x-form-border-hover-color:gray400
|
|
36
|
+
@components--focus[border-color--x-form-accent-color:primary600,ring--x-form-ring-color:primary600/0.2]
|
|
37
|
+
@components--user-invalid-border-color--x-form-error-color:error600
|
|
38
|
+
@components-[aria-invalid=true]-border-color--x-form-error-color:error600
|
|
39
|
+
@components--user-invalid--focus-ring--x-form-error-ring-color:error600/0.2
|
|
40
|
+
@components-[aria-invalid=true]--focus-ring--x-form-error-ring-color:error600/0.2
|
|
41
|
+
@components--disabled[bgc--x-form-disabled-bg:gray50,c--x-form-disabled-color:gray500,cursor-not-allowed]
|
|
42
|
+
`;
|
|
43
|
+
// Shared checkbox / radio box styles
|
|
44
|
+
const choiceBox = `
|
|
45
|
+
@base-[appearance-none,m-0]
|
|
46
|
+
@components[d-inline-grid,place-content-center,flex-shrink-0,w--x-check-size:18px,h--x-check-size:18px,box-sizing-border-box,border-width-1px,border-style-solid,border-color--x-form-border-color:gray300,bgc--x-form-bg:white,cursor-pointer,transition-property-background-color__border-color,transition-duration-0.15s]
|
|
47
|
+
@components--checked[bgc--x-form-accent-color:primary600,border-color--x-form-accent-color:primary600]
|
|
48
|
+
${focusVisible}
|
|
49
|
+
@components--disabled[o-0.5,cursor-not-allowed]
|
|
50
|
+
`;
|
|
51
|
+
const formComponents = {
|
|
52
|
+
// ---------------- Button ----------------
|
|
53
|
+
// <button class="x-button">Save</button>
|
|
54
|
+
// Variants: x-button-secondary, x-button-ghost, x-button-danger
|
|
55
|
+
// Sizes: x-button-sm, x-button-lg, x-button-icon
|
|
56
|
+
'x-button': {
|
|
57
|
+
type: 'statement',
|
|
58
|
+
statement: `
|
|
59
|
+
@base-all-unset
|
|
60
|
+
@components[d-inline-flex,aic,jcc,g-8px,box-sizing-border-box,h--x-form-height:40px,padding-inline--x-button-padding:16px,br--x-form-radius:8px,border-width-1px,border-style-solid,border-color--x-button-border-color:transparent,bgc--x-button-bg:primary600,c--x-button-color:white,fs--x-button-font-size:15px,fw-600,lh-1,white-space-nowrap,user-select-none,cursor-pointer,transition-property-background-color__border-color__color__transform,transition-duration-0.15s]
|
|
61
|
+
@components--enabled--hover-bgc--x-button-hover-bg:primary700
|
|
62
|
+
@components--enabled--active-tf-scale-0.98
|
|
63
|
+
${focusVisible}
|
|
64
|
+
@components--disabled[o-0.5,cursor-not-allowed]
|
|
65
|
+
@components-[aria-disabled=true][o-0.5,cursor-not-allowed,pointer-events-none]
|
|
66
|
+
`
|
|
67
|
+
},
|
|
68
|
+
'x-button-secondary': {
|
|
69
|
+
type: 'statement',
|
|
70
|
+
statement: `--x-button-bg:white --x-button-hover-bg:gray50 --x-button-color:gray700 --x-button-border-color:gray300`
|
|
71
|
+
},
|
|
72
|
+
'x-button-ghost': {
|
|
73
|
+
type: 'statement',
|
|
74
|
+
statement: `--x-button-bg:transparent --x-button-hover-bg:gray100 --x-button-color:gray700 --x-button-border-color:transparent`
|
|
75
|
+
},
|
|
76
|
+
'x-button-danger': {
|
|
77
|
+
type: 'statement',
|
|
78
|
+
statement: `--x-button-bg:error600 --x-button-hover-bg:error700 --x-button-color:white --x-button-border-color:transparent`
|
|
79
|
+
},
|
|
80
|
+
'x-button-sm': {
|
|
81
|
+
type: 'statement',
|
|
82
|
+
statement: `--x-form-height:32px --x-button-padding:12px --x-button-font-size:14px`
|
|
83
|
+
},
|
|
84
|
+
'x-button-lg': {
|
|
85
|
+
type: 'statement',
|
|
86
|
+
statement: `--x-form-height:48px --x-button-padding:20px --x-button-font-size:16px`
|
|
87
|
+
},
|
|
88
|
+
'x-button-icon': {
|
|
89
|
+
// square icon-only button: <button class="x-button x-button-icon" aria-label="Close">…</button>
|
|
90
|
+
type: 'statement',
|
|
91
|
+
statement: `--x-button-padding:0px w--x-form-height:40px`
|
|
92
|
+
},
|
|
93
|
+
// ---------------- Text fields ----------------
|
|
94
|
+
// <input class="x-input" type="email">
|
|
95
|
+
'x-input': {
|
|
96
|
+
type: 'statement',
|
|
97
|
+
statement: field
|
|
98
|
+
},
|
|
99
|
+
// <textarea class="x-textarea"></textarea>
|
|
100
|
+
'x-textarea': {
|
|
101
|
+
type: 'statement',
|
|
102
|
+
statement: `
|
|
103
|
+
${field}
|
|
104
|
+
@components[h-auto,mh--x-textarea-min-height:96px,p-10px-12px,resize-vertical]
|
|
105
|
+
`
|
|
106
|
+
},
|
|
107
|
+
// <select class="x-select">…</select>
|
|
108
|
+
'x-select': {
|
|
109
|
+
type: 'statement',
|
|
110
|
+
statement: `
|
|
111
|
+
${field}
|
|
112
|
+
@components[cursor-pointer,padding-right-36px,background-repeat-no-repeat]
|
|
113
|
+
@components-background-image(linear-gradient(45deg,transparent_50%,currentColor_50%),linear-gradient(135deg,currentColor_50%,transparent_50%))
|
|
114
|
+
@components-background-position(calc(100%_-_19px)_50%,calc(100%_-_14px)_50%)
|
|
115
|
+
@components-background-size(5px_5px,5px_5px)
|
|
116
|
+
`
|
|
117
|
+
},
|
|
118
|
+
// ---------------- Checkbox / radio / switch ----------------
|
|
119
|
+
// <input type="checkbox" class="x-checkbox">
|
|
120
|
+
'x-checkbox': {
|
|
121
|
+
type: 'statement',
|
|
122
|
+
statement: `
|
|
123
|
+
${choiceBox}
|
|
124
|
+
@components-br--x-check-radius:4px
|
|
125
|
+
@components--before[cont,w(calc(var(--x-check-size,18px)*0.6)),h(calc(var(--x-check-size,18px)*0.6)),bgc--x-check-mark-color:white,clip-path(polygon(14%_44%,0_65%,50%_100%,100%_16%,80%_0%,43%_62%)),tf-scale-0,transition-property-transform,transition-duration-0.15s]
|
|
126
|
+
@components--checked--before-tf-scale-1
|
|
127
|
+
@components--indeterminate[bgc--x-form-accent-color:primary600,border-color--x-form-accent-color:primary600]
|
|
128
|
+
@components--indeterminate--before[tf-scale-1,clip-path(inset(40%_0))]
|
|
129
|
+
`
|
|
130
|
+
},
|
|
131
|
+
// <input type="radio" class="x-radio">
|
|
132
|
+
'x-radio': {
|
|
133
|
+
type: 'statement',
|
|
134
|
+
statement: `
|
|
135
|
+
${choiceBox}
|
|
136
|
+
@components-br-50%
|
|
137
|
+
@components--before[cont,w(calc(var(--x-check-size,18px)*0.45)),h(calc(var(--x-check-size,18px)*0.45)),br-50%,bgc--x-check-mark-color:white,tf-scale-0,transition-property-transform,transition-duration-0.15s]
|
|
138
|
+
@components--checked--before-tf-scale-1
|
|
139
|
+
`
|
|
140
|
+
},
|
|
141
|
+
// <input type="checkbox" role="switch" class="x-switch">
|
|
142
|
+
'x-switch': {
|
|
143
|
+
type: 'statement',
|
|
144
|
+
statement: `
|
|
145
|
+
@base-[appearance-none,m-0]
|
|
146
|
+
@components[position-relative,d-inline-block,flex-shrink-0,w--x-switch-width:36px,h--x-switch-height:20px,box-sizing-border-box,br-999px,bgc--x-switch-bg:gray200,cursor-pointer,transition-property-background-color,transition-duration-0.2s]
|
|
147
|
+
@components--before[cont,position-absolute,t-2px,l-2px,w(calc(var(--x-switch-height,20px)_-_4px)),h(calc(var(--x-switch-height,20px)_-_4px)),br-50%,bgc--x-switch-thumb-color:white,bxs-0px-1px-2px-black/0.2,transition-property-transform,transition-duration-0.2s]
|
|
148
|
+
@components--checked-bgc--x-form-accent-color:primary600
|
|
149
|
+
@components--checked--before-transform(translateX(calc(var(--x-switch-width,36px)_-_var(--x-switch-height,20px))))
|
|
150
|
+
${focusVisible}
|
|
151
|
+
@components--disabled[o-0.5,cursor-not-allowed]
|
|
152
|
+
`
|
|
153
|
+
},
|
|
154
|
+
// ---------------- Layout helpers ----------------
|
|
155
|
+
// <div class="x-field">
|
|
156
|
+
// <label class="x-label" for="email">Email</label>
|
|
157
|
+
// <input class="x-input" id="email">
|
|
158
|
+
// <p class="x-hint">We'll never share it.</p>
|
|
159
|
+
// </div>
|
|
160
|
+
'x-field': {
|
|
161
|
+
type: 'statement',
|
|
162
|
+
statement: `@components[d-flex,flex-direction-column,g-6px]`
|
|
163
|
+
},
|
|
164
|
+
'x-label': {
|
|
165
|
+
type: 'statement',
|
|
166
|
+
statement: `@components[fs-14px,fw-500,lh-20px,c--x-form-label-color:gray700]`
|
|
167
|
+
},
|
|
168
|
+
'x-hint': {
|
|
169
|
+
type: 'statement',
|
|
170
|
+
statement: `@components[m-0,fs-13px,lh-18px,c--x-form-hint-color:gray500]`
|
|
171
|
+
},
|
|
172
|
+
'x-error-text': {
|
|
173
|
+
type: 'statement',
|
|
174
|
+
statement: `@components[m-0,fs-13px,lh-18px,c--x-form-error-color:error600]`
|
|
175
|
+
},
|
|
176
|
+
// Label wrapping a checkbox / radio / switch:
|
|
177
|
+
// <label class="x-choice"><input type="checkbox" class="x-checkbox"> Remember me</label>
|
|
178
|
+
'x-choice': {
|
|
179
|
+
type: 'statement',
|
|
180
|
+
statement: `
|
|
181
|
+
@components[d-inline-flex,aic,g-8px,fs-14px,lh-20px,c--x-form-color:gray900,cursor-pointer]
|
|
182
|
+
@components--has(_input--disabled)[o-0.5,cursor-not-allowed]
|
|
183
|
+
`
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
export default formComponents;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
declare const layout: {
|
|
2
|
+
'x-stack': {
|
|
3
|
+
type: string;
|
|
4
|
+
statement: string;
|
|
5
|
+
};
|
|
6
|
+
'x-stack-end': {
|
|
7
|
+
type: string;
|
|
8
|
+
statement: string;
|
|
9
|
+
};
|
|
10
|
+
'x-cluster': {
|
|
11
|
+
type: string;
|
|
12
|
+
statement: string;
|
|
13
|
+
};
|
|
14
|
+
'x-cluster-end': {
|
|
15
|
+
type: string;
|
|
16
|
+
statement: string;
|
|
17
|
+
};
|
|
18
|
+
'x-center': {
|
|
19
|
+
type: string;
|
|
20
|
+
statement: string;
|
|
21
|
+
};
|
|
22
|
+
'x-grid': {
|
|
23
|
+
type: string;
|
|
24
|
+
statement: string;
|
|
25
|
+
};
|
|
26
|
+
'x-grid-fit': {
|
|
27
|
+
type: string;
|
|
28
|
+
statement: string;
|
|
29
|
+
};
|
|
30
|
+
'x-switcher': {
|
|
31
|
+
type: string;
|
|
32
|
+
statement: string;
|
|
33
|
+
};
|
|
34
|
+
'x-sidebar': {
|
|
35
|
+
type: string;
|
|
36
|
+
statement: string;
|
|
37
|
+
};
|
|
38
|
+
'x-sidebar-right': {
|
|
39
|
+
type: string;
|
|
40
|
+
statement: string;
|
|
41
|
+
};
|
|
42
|
+
'x-cover': {
|
|
43
|
+
type: string;
|
|
44
|
+
statement: string;
|
|
45
|
+
};
|
|
46
|
+
'x-cover-center': {
|
|
47
|
+
type: string;
|
|
48
|
+
statement: string;
|
|
49
|
+
};
|
|
50
|
+
'x-frame': {
|
|
51
|
+
type: string;
|
|
52
|
+
statement: string;
|
|
53
|
+
};
|
|
54
|
+
'x-reel': {
|
|
55
|
+
type: string;
|
|
56
|
+
statement: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export default layout;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// AliasCSS layout primitives
|
|
2
|
+
// ------------------------------------------------------------------
|
|
3
|
+
// Small, composable layouts that adapt to the space they're given,
|
|
4
|
+
// so most pages need far fewer @xs/@sm/@md classes.
|
|
5
|
+
//
|
|
6
|
+
// x-stack vertical flow with consistent gap (x-stack-end pushes an item to the bottom)
|
|
7
|
+
// x-cluster wrapping row of items (tags, buttons) (x-cluster-end pushes an item to the right)
|
|
8
|
+
// x-center centered max-width container with side gutters
|
|
9
|
+
// x-grid auto-filling responsive grid (x-grid-fit stretches items when there are few)
|
|
10
|
+
// x-switcher row of equal items that becomes a column below a threshold width
|
|
11
|
+
// x-sidebar sidebar + content, wraps when content gets too narrow (x-sidebar-right flips it)
|
|
12
|
+
// x-cover full-height section with a vertically centered child (x-cover-center)
|
|
13
|
+
// x-frame fixed aspect-ratio crop for images/video
|
|
14
|
+
// x-reel horizontal scrolling strip with snap
|
|
15
|
+
//
|
|
16
|
+
// Everything is in @components, so plain utilities override it:
|
|
17
|
+
// class="x-stack g-24px" or class="x-grid g-8px"
|
|
18
|
+
// Or set the variables, e.g. class="x-grid --x-grid-min:180px".
|
|
19
|
+
// Note: custom properties inherit, so a variable set on an outer layout
|
|
20
|
+
// also reaches nested layouts of the same kind. Plain utilities don't have that issue.
|
|
21
|
+
// ------------------------------------------------------------------
|
|
22
|
+
const layout = {
|
|
23
|
+
// <div class="x-stack">…</div> vars: --x-stack-gap (16px)
|
|
24
|
+
'x-stack': {
|
|
25
|
+
type: 'statement',
|
|
26
|
+
statement: `@components[d-flex,flex-direction-column,g--x-stack-gap:16px]`
|
|
27
|
+
},
|
|
28
|
+
'x-stack-end': {
|
|
29
|
+
type: 'statement',
|
|
30
|
+
statement: `@components[margin-block-start-auto]`
|
|
31
|
+
},
|
|
32
|
+
// <div class="x-cluster">…</div> vars: --x-cluster-gap (12px), --x-cluster-justify, --x-cluster-align
|
|
33
|
+
'x-cluster': {
|
|
34
|
+
type: 'statement',
|
|
35
|
+
statement: `@components[d-flex,flex-wrap-wrap,align-items--x-cluster-align:center,justify-content--x-cluster-justify:flex-start,g--x-cluster-gap:12px]`
|
|
36
|
+
},
|
|
37
|
+
'x-cluster-end': {
|
|
38
|
+
type: 'statement',
|
|
39
|
+
statement: `@components[margin-inline-start-auto]`
|
|
40
|
+
},
|
|
41
|
+
// <div class="x-center">…</div> vars: --x-center-max (960px), --x-center-gutter (16px)
|
|
42
|
+
'x-center': {
|
|
43
|
+
type: 'statement',
|
|
44
|
+
statement: `@components[box-sizing-content-box,max-inline-size--x-center-max:960px,margin-inline-auto,padding-inline--x-center-gutter:16px]`
|
|
45
|
+
},
|
|
46
|
+
// <div class="x-grid">…cards…</div> vars: --x-grid-min (240px), --x-grid-gap (16px)
|
|
47
|
+
// auto-fill keeps empty tracks (items keep their size); x-grid-fit uses auto-fit (items stretch).
|
|
48
|
+
'x-grid': {
|
|
49
|
+
type: 'statement',
|
|
50
|
+
statement: `@components[d-grid,g--x-grid-gap:16px,grid-template-columns(repeat(auto-fill,minmax(min(var(--x-grid-min,240px),100%),1fr)))]`
|
|
51
|
+
},
|
|
52
|
+
'x-grid-fit': {
|
|
53
|
+
type: 'statement',
|
|
54
|
+
statement: `@components-[class]-grid-template-columns(repeat(auto-fit,minmax(min(var(--x-grid-min,240px),100%),1fr)))`
|
|
55
|
+
},
|
|
56
|
+
// <div class="x-switcher"><div>A</div><div>B</div><div>C</div></div>
|
|
57
|
+
// Items sit in a row while the container is wider than the threshold, otherwise they stack.
|
|
58
|
+
// vars: --x-switcher-threshold (640px), --x-switcher-gap (16px)
|
|
59
|
+
'x-switcher': {
|
|
60
|
+
type: 'statement',
|
|
61
|
+
statement: `
|
|
62
|
+
@components[d-flex,flex-wrap-wrap,g--x-switcher-gap:16px]
|
|
63
|
+
@components__all[flex-grow-1,flex-basis(calc((var(--x-switcher-threshold,640px)_-_100%)_*_999))]
|
|
64
|
+
`
|
|
65
|
+
},
|
|
66
|
+
// <div class="x-sidebar"><aside>Sidebar</aside><main>Content</main></div>
|
|
67
|
+
// vars: --x-sidebar-width (280px), --x-sidebar-content-min (60%), --x-sidebar-gap (24px)
|
|
68
|
+
'x-sidebar': {
|
|
69
|
+
type: 'statement',
|
|
70
|
+
statement: `
|
|
71
|
+
@components[d-flex,flex-wrap-wrap,g--x-sidebar-gap:24px]
|
|
72
|
+
@components__all--first-child[flex-grow-1,flex-basis--x-sidebar-width:280px]
|
|
73
|
+
@components__all--last-child[flex-grow-999,flex-basis-0px,min-inline-size--x-sidebar-content-min:60%]
|
|
74
|
+
`
|
|
75
|
+
},
|
|
76
|
+
// <div class="x-sidebar x-sidebar-right"><main>Content</main><aside>Sidebar</aside></div>
|
|
77
|
+
'x-sidebar-right': {
|
|
78
|
+
type: 'statement',
|
|
79
|
+
statement: `
|
|
80
|
+
@components-[class]__all--first-child[flex-grow-999,flex-basis-0px,min-inline-size--x-sidebar-content-min:60%]
|
|
81
|
+
@components-[class]__all--last-child[flex-grow-1,flex-basis--x-sidebar-width:280px,min-inline-size(auto)]
|
|
82
|
+
`
|
|
83
|
+
},
|
|
84
|
+
// <section class="x-cover"><header>…</header><h1 class="x-cover-center">Hero</h1><footer>…</footer></section>
|
|
85
|
+
// vars: --x-cover-min-height (100dvh), --x-cover-padding (16px), --x-cover-gap (16px)
|
|
86
|
+
'x-cover': {
|
|
87
|
+
type: 'statement',
|
|
88
|
+
statement: `@components[d-flex,flex-direction-column,box-sizing-border-box,mh--x-cover-min-height:100dvh,padding--x-cover-padding:16px,g--x-cover-gap:16px]`
|
|
89
|
+
},
|
|
90
|
+
'x-cover-center': {
|
|
91
|
+
type: 'statement',
|
|
92
|
+
statement: `@components[margin-block-auto]`
|
|
93
|
+
},
|
|
94
|
+
// <div class="x-frame"><img src="…" alt=""></div> vars: --x-frame-ratio (16/9)
|
|
95
|
+
'x-frame': {
|
|
96
|
+
type: 'statement',
|
|
97
|
+
statement: `
|
|
98
|
+
@components[d-flex,jcc,aic,overflow-hidden,aspect-ratio--x-frame-ratio:16/9]
|
|
99
|
+
@components__img[w-100%,h-100%,object-fit-cover]
|
|
100
|
+
@components__video[w-100%,h-100%,object-fit-cover]
|
|
101
|
+
`
|
|
102
|
+
},
|
|
103
|
+
// <div class="x-reel"><div>…</div><div>…</div>…</div>
|
|
104
|
+
// vars: --x-reel-item-width (280px), --x-reel-gap (16px)
|
|
105
|
+
'x-reel': {
|
|
106
|
+
type: 'statement',
|
|
107
|
+
statement: `
|
|
108
|
+
@components[d-flex,g--x-reel-gap:16px,overflow-x-auto,overscroll-behavior-inline-contain,scroll-snap-type-x-mandatory,padding-block-end-8px]
|
|
109
|
+
@components__all[flex(0_0_var(--x-reel-item-width,280px)),scroll-snap-align-start]
|
|
110
|
+
`
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
export default layout;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
declare const navContent: {
|
|
2
|
+
'x-tab-list': {
|
|
3
|
+
type: string;
|
|
4
|
+
statement: string;
|
|
5
|
+
};
|
|
6
|
+
'x-tab': {
|
|
7
|
+
type: string;
|
|
8
|
+
statement: string;
|
|
9
|
+
};
|
|
10
|
+
'x-tab-panel': {
|
|
11
|
+
type: string;
|
|
12
|
+
statement: string;
|
|
13
|
+
};
|
|
14
|
+
'x-tab-list-pills': {
|
|
15
|
+
type: string;
|
|
16
|
+
statement: string;
|
|
17
|
+
};
|
|
18
|
+
'x-breadcrumb': {
|
|
19
|
+
type: string;
|
|
20
|
+
statement: string;
|
|
21
|
+
};
|
|
22
|
+
'x-pagination': {
|
|
23
|
+
type: string;
|
|
24
|
+
statement: string;
|
|
25
|
+
};
|
|
26
|
+
'x-dropdown': {
|
|
27
|
+
type: string;
|
|
28
|
+
statement: string;
|
|
29
|
+
};
|
|
30
|
+
'x-dropdown-item': {
|
|
31
|
+
type: string;
|
|
32
|
+
statement: string;
|
|
33
|
+
};
|
|
34
|
+
'x-dropdown-item-danger': {
|
|
35
|
+
type: string;
|
|
36
|
+
statement: string;
|
|
37
|
+
};
|
|
38
|
+
'x-dropdown-divider': {
|
|
39
|
+
type: string;
|
|
40
|
+
statement: string;
|
|
41
|
+
};
|
|
42
|
+
'x-dropdown-label': {
|
|
43
|
+
type: string;
|
|
44
|
+
statement: string;
|
|
45
|
+
};
|
|
46
|
+
'x-prose': {
|
|
47
|
+
type: string;
|
|
48
|
+
statement: string;
|
|
49
|
+
};
|
|
50
|
+
'x-prose-sm': {
|
|
51
|
+
type: string;
|
|
52
|
+
statement: string;
|
|
53
|
+
};
|
|
54
|
+
'x-prose-lg': {
|
|
55
|
+
type: string;
|
|
56
|
+
statement: string;
|
|
57
|
+
};
|
|
58
|
+
'x-kbd': {
|
|
59
|
+
type: string;
|
|
60
|
+
statement: string;
|
|
61
|
+
};
|
|
62
|
+
'x-code': {
|
|
63
|
+
type: string;
|
|
64
|
+
statement: string;
|
|
65
|
+
};
|
|
66
|
+
'x-code-block': {
|
|
67
|
+
type: string;
|
|
68
|
+
statement: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export default navContent;
|