Bot releases are visible (Hide)
Published by 1aron almost 2 years ago
options.root
exists, auto observe()
it (9853a4c)Published by 1aron almost 2 years ago
Support colors
group configuration and access extended config.colors
to simplify markup (b4b053b)
Set the foreground color of the code by theme:
module.exports = {
themes: {
light: {
colors: {
- 'code-fade': defaultColors.slate['60'],
- 'code-pink': defaultColors.pink['50'],
+ code: {
+ fade: 'slate-60',
+ pink: 'pink-50',
+ }
},
},
dark: {
colors: {
- 'code-fade': defaultColors.gray['55'],
- 'code-pink': defaultColors.pink['70'],
+ code: {
+ fade: 'gray-55',
+ pink: 'pink-70',
+ }
}
}
}
}
and it only needs to be marked once:
<span class="fg:code-fade">{}</span>
<span class="fg:code-pink">div</span>
⚠️ Group configuration .colors
doesn't support nesting to avoid designs where a single class name is too long and increases the size of the markup, but you can still do this with other Design Tokens:
<div className={`fg:${tokens.button.cta.foreground.color}`}>...</div>
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
Using new MasterCSS
to initialize uniformly, and preset different behaviors according to ESM
, CJS
, IIFE
init(config)
API and use new MasterCSS(options)
insteadimport config from './master.css'
- import { init } from '@master/css'
+ import MasterCSS from '@master/css'
- export const css = init(config)
+ export const css = new MasterCSS({ config })
Complete initial code master.js
:
import config from './master.css'
import MasterCSS from '@master/css'
export const css = new MasterCSS({ config })
Create MasterCSS
configurable options:
export declare type MasterCSSOptions = {
config?: MasterCSSConfig // your custom config
override?: boolean // not to extend default config
observe?: boolean // automatically observe document after initialization
}
IIFE
format in the browser, it'll automatically initialize<head>
<script src="https://cdn.master.co/[email protected]"></script>
</head>
You can also customize your configuration directly in HTML before importing:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
window.masterCSSConfig = {
colors: {
primary: '#ff0000'
}
}
</script>
<script src="https://cdn.master.co/[email protected]"></script>
</head>
<body>
<h1 class="font:40 font:heavy italic m:50 text:center fg:primary">Hello World</h1>
</body>
</html>
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
scheme.preference
, which should be customized by the developer (1488475)Published by 1aron almost 2 years ago
remove configure()
api, preset extend behavior and provide override
config (3562216)
/* master.css.js */
- import { configure } from '@master/css'
- module.exports = configure({
+ module.exports = {
....
}
Published by 1aron almost 2 years ago
.cjs
, .mjs
(2105d7d)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
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
Published by 1aron almost 2 years ago
AccentColor
key (4768308)configure
filters undefined
params (60a263f)fillShades
method (aa0519a)Group
relations (fedf33b)init
API (bfe862a)init
API (9b35dcc)onThemeChange
this scape (70005d8)package.json
esm (a400233)refresh
(1dbd26f)scheme
and theme
(1c46352)this
undefined (2d230ad)sideEffects
to package.json (acd4e57).values
(055c466)55
(b874309)init
method (a41beaa)mergeAndConcat
method (19a137c)extend
(9ae2e14)id
by propName
(fb1fd14)vendor-prefixed
(9716298)scheme
(c8fd4d4)values
by id
(553d61e)./polyfills/css-escape.js
no side effects (fe519b2)WordSpacing
unit to em
(74a263b)console.time
(0d5c44c)CURRENT_COLOR
constant (4e3ba4a)Font.colorful
(918223a)fillShades
(41251c7)config.validateRule
api (18cd8e2)(bg|background):current
for background-color:currentColor
(2f8120e)(fg|foreground|color):transparent
for color:transparent
(9271423)accent:(current|transparent)
for accent-color:(currentColor|transparent)
(70d0e16)outline:(?:current|transparent)
for outline-color:(currentColor|transparent)
(6e288a2)rootSize
to configuration (4741c2c)t:color
acronym syntax for -webkit-text-fill-color
(4dae7a6)text-stroke:(?:current|transparent)
for -webkit-text-stroke-color:(current|transparent)
(c27913f)text:color
shorthand for text-fill-color
(b6ccd81)text(?:-fill)?:(?:current|transparent)
for -webkit-text-fill-color:transparent
(619f62a)(fg|foreground):color
shorthand for color:
(a17aa82).selectors
tokens (6225b95)configurations
(0aaa384)scheme
event to host (bdab18b)theme
event to host (3ad4b2c)render()
, renderFromHTML()
, renderIntoHTML
(bac75c6)::-moz-range-track
(5b12857)%
to set opacity (d42e30a)(transparent|current)
sensing to reduce color-related matching logic (9973181)current
to currentColor
to reduce color-related default value declarations (5d1ab1f)FontColor
to Color
and remove (font|f):color
syntaxPublished 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