css

The CSS Language and Framework

MIT License

Downloads
6.8K
Stars
1.7K
Committers
14

Bot releases are hidden (Show)

css - v2.0.0-beta.26

Published by 1aron almost 2 years ago

Performance Improvements

  • remove propName for less output size (78f5efa)
css - v1.37.3

Published by 1aron almost 2 years ago

Bug Fixes

  • filter/backdrop-filter don't support color tokens (6afb0c7)
css - v2.0.0-beta.25

Published by 1aron almost 2 years ago

Bug Fixes

  • backdrop-filter doesn't support color tokens (cb36a6b)
  • filter doesn't support color tokens (3288b6b)
css - v2.0.0-beta.24

Published by 1aron almost 2 years ago

Bug Fixes

  • colorful style with inherit value (4cf8095)
css - v2.0.0-beta.23

Published by 1aron almost 2 years ago

Features

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

Published by 1aron almost 2 years ago

Bug Fixes

css - v2.0.0-beta.21

Published by 1aron almost 2 years ago

Features

css - v2.0.0-beta.20

Published by 1aron almost 2 years ago

Bug Fixes

  • tokenize extended colors with default color (74b4278)
css - v2.0.0-beta.19

Published by 1aron almost 2 years ago

Features

  • access extended color tokens (b727379)
css - v2.0.0-beta.17

Published by 1aron almost 2 years ago

Bug Fixes

  • document observed by default (d408a9b)
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