Bot releases are visible (Hide)
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
CSS - Support unit conversion for configuration (0d8902b)
export default {
values: {
- '2x': '2rem',
+ '2x': 32,
- '3x': '3rem',
+ '3x': 48,
FontSize: {
- sm: '1rem',
+ sm: 16,
- md: '1.5rem',
+ md: 25
},
LetterSpacing: {
- wide: '0.025em',
+ wide: .4
},
}
}
Published by 1aron almost 2 years ago
nested configuration for breakpoints
/ colors
/ selectors
/ semantics
/ values
(f7e574e)
This feature is used to simplify, format your custom configuration and avoid writing the same name repeatedly. Supported configurations include .breakpoints
, .colors
, .selectors
, .semantics
, .values
:
/** @type {import('@master/css').Config} */
export default {
colors: {
primary: '#ebbb40', // fg:primary
- 'code-silence': 'slate-70',
- 'code-js-pink': 'pink-70',
- 'code-js-blue': 'blue-70',
+ code: {
+ silence: 'slate-70',
+ js: {
+ pink: 'pink-70',
+ blue: 'blue-70',
+ }
+ }
},
semantics: {
- show: 'display:block',
+ show: {
+ display: 'block'
+ }
},
values: {
Width: {
- 'content-xs': '37.5rem',
- 'content-sm': '48rem',
+ content: {
+ xs: '37.5rem'
+ sm: '48rem'
+ }
}
},
...
}
Applied in HTML:
<code class="fg:code-js-pink fg:code-silence.disabled disabled">...</code>
<div class="show!" hidden>...</div>
<article class="w:content-xs w:content-sm@lg">...</div>
<article class="w:600 w:768@lg">same as built-in</div>
<article class="w:xs w:sm@lg">same as built-in</div>
It can be observed that the Master takes the key defined by the nesting of concatenation -
as the class name.
⚠️ In order to prevent the class name from being too long, the best practice for nested configuration is 2-3 layers.
Published by 1aron almost 2 years ago
config.values
typing (456397f)Published by 1aron almost 2 years ago
master.css.js
- /** @type {import('@master/css').MasterCSSConfig} */
+ /** @type {import('@master/css').Config} */
export default { ... }
.prioritySelectorIndex
to .priority
MasterCSSOptions
to Options
MasterCSSConfig
to Config
MasterCSSRule
to Rule
MasterCSSRuleMatching
to RuleMatching
MasterCSSDeclaration
to Declaration
MasterCSSMedia
to MediaQuery
MasterCSSMediaFeatureRule
to MediaFeatureRule
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
propName
for less output size (78f5efa)Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
inherit
value (4cf8095)Published by 1aron almost 2 years ago
global values (859d4d6)
Previously config.values
only supported default rules such as BoxShadow
, FontFamily
.
Now, tokens starting with a non-capital letter are global:
/* master.css.js */
/** @type {import('@master/css').MasterCSSConfig} */
export default {
values: {
'2x': '.5rem',
'3x': '.75rem',
'4x': '1rem',
FontFamily: {
sans: 'Inter var, Noto Sans TC, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue',
mono: 'Fira Code VF, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace'
}
},
...
}
Then mark it directly in the HTML:
<div class="mt:2x w:4x@sm p:3x font:mono">...</div>
Published by 1aron almost 2 years ago
text-size
diff (327013b)Published by 1aron almost 2 years ago
counter-reset
style (e8aafc5)Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago