css

The CSS Language and Framework

MIT License

Downloads
6.8K
Stars
1.7K
Committers
14

Bot releases are visible (Hide)

css - v2.0.0-beta.16

Published by 1aron almost 2 years ago

Bug Fixes

  • if options.root exists, auto observe() it (9853a4c)
css - v2.0.0-beta.15

Published by 1aron almost 2 years ago

Features

  • 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>
    
css - v2.0.0-beta.14

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.13

Published by 1aron almost 2 years ago

Using new MasterCSS to initialize uniformly, and preset different behaviors according to ESM, CJS, IIFE

Remove init(config) API and use new MasterCSS(options) instead

import 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
}

Import the output bundle in 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>
css - v2.0.0-beta.12

Published by 1aron almost 2 years ago

Bug Fixes

  • instantly initialize when the script is directly imported into the browser (58a31a6)
css - v2.0.0-beta.11

Published by 1aron almost 2 years ago

Bug Fixes

  • remove default scheme.preference, which should be customized by the developer (1488475)
css - v2.0.0-beta.10

Published by 1aron almost 2 years ago

Features

  • remove configure() api, preset extend behavior and provide override config (3562216)

    /* master.css.js */
    - import { configure } from '@master/css'
    - module.exports = configure({
    + module.exports = {
        ....
    }
    
css - v2.0.0-beta.9

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.8

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.7

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.6

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.5

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.4

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.3

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.2

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.1

Published by 1aron almost 2 years ago

Bug Fixes

Features

  • config.validateRule api (18cd8e2)
  • accept array ‘themes’ (c780327)
  • add (bg|background):current for background-color:currentColor (2f8120e)
  • add (fg|foreground|color):transparent for color:transparent (9271423)
  • add accent:(current|transparent) for accent-color:(currentColor|transparent) (70d0e16)
  • add outline:(?:current|transparent) for outline-color:(currentColor|transparent) (6e288a2)
  • add rootSize to configuration (4741c2c)
  • add t:color acronym syntax for -webkit-text-fill-color (4dae7a6)
  • add text-stroke:(?:current|transparent) for -webkit-text-stroke-color:(current|transparent) (c27913f)
  • add text:color shorthand for text-fill-color (b6ccd81)
  • add text(?:-fill)?:(?:current|transparent) for -webkit-text-fill-color:transparent (619f62a)
  • color: add (fg|foreground):color shorthand for color: (a17aa82)
  • customize .selectors tokens (6225b95)
  • deeply merge and concat configurations (0aaa384)
  • dispatch scheme event to host (bdab18b)
  • dispatch theme event to host (3ad4b2c)
  • get whole css text (6cafce4)
  • grouping selectors (b775127)
  • hydrate CSS from the related AOT file (70a1005)
  • new rendering APIs render(), renderFromHTML(), renderIntoHTML (bac75c6)
  • support ::-moz-range-track (5b12857)
  • support esm (f403932)
  • support for using % to set opacity (d42e30a)
  • theme scheme (ba396f0)

Performance Improvements

  • built in (transparent|current) sensing to reduce color-related matching logic (9973181)
  • built in mapping of current to currentColor to reduce color-related default value declarations (5d1ab1f)
  • remove constants to minify (049cc4b)
  • remove constants to minify (74c186c)

BREAKING CHANGES

  • color: rename FontColor to Color and remove (font|f):color syntax
css - v2.0.0-alpha.80

Published by 1aron almost 2 years ago

2.0.0-alpha.80 (2022-10-23)

css - v2.0.0-alpha.79

Published by 1aron almost 2 years ago

2.0.0-alpha.79 (2022-10-23)

Bug Fixes

Features

  • hydrate CSS from the related AOT file (70a1005)
css - v2.0.0-alpha.78

Published by 1aron almost 2 years ago

2.0.0-alpha.78 (2022-10-23)

Features

  • dispatch theme event to host (3ad4b2c)
css - v2.0.0-alpha.77

Published by 1aron almost 2 years ago

2.0.0-alpha.77 (2022-10-23)

Features

  • dispatch scheme event to host (bdab18b)