Skip to content

Releases: master-co/css

v2.0.0-rc.48

20 Jan 16:25
Compare
Choose a tag to compare
v2.0.0-rc.48 Pre-release
Pre-release

New Features

Cascade layers, resolved #354 @1aron 92277ab

The new cascade layers allows you to manage styles and their precedences more systematically. You can just write your classes as usual without having to worry about style conflicts:

<body class="list-style:none_ul@base">
    <button class="btn flex">Submit</button>
    <ul class="@fade|1s"></ul>
    <article class="text:16_p@preset">
        <p></p>
    </article>
</body>
export default {
    variables: {
        primary: {
            '@light': '#000000',
            '@dark': '#ffffff'
        }
    },
    components: {
        btn: 'inline-flex bg:primary'
    }
}

Generated CSS:

@layer base, theme, preset, components, general;
 
@layer base {
    .list-style\:none_ul\@base ul {
        list-style: none
    }
}
 
@layer theme {
 
    .light,
    :root {
        --primary: 0 0 0
    }
 
    .dark {
        --primary: 255 255 255
    }
}
 
@layer preset {
    .text\:16_p\@preset p {
        font-size: 1rem;
        line-height: calc(1rem + 0.875em)
    }
}
 
@layer components {
    .btn {
        display: inline-flex;
        background-color: rgb(var(--primary))
    }
}
 
@layer general {
    .flex {
        display: flex
    }
 
    .\@fade\|1s {
        animation: fade 1s
    }
}
 
@keyframes fade {
    0% {
        opacity: 0
    }
 
    to {
        opacity: 1
    }
}

Stateful Components, resolved #258

Now you can give abstract components states, such as btn-sm@<sm

<button class="btn btn-md btn-sm@<sm …">Submit</button>
export default {
    components: {
        btn: {
            '': '… inline-flex font:semibold',
            'sm': 'font:12 h:8x px:3x r:6',
            'md': 'font:14 h:10x px:4x r:6',
        }
    }
}

Generated CSS:

@layer base, theme, preset, components, general;
 
@layer components {
    .btn-md {
        font-size: 0.875rem;
        height: 2.5rem;
        padding-left: 1rem;
        padding-right: 1rem;
        border-radius: 0.375rem
    }
 
    .btn {
        display: inline-flex;
        font-weight: 600
    }
 
    @media (max-width:833.98px) {
        .btn-sm\@\<sm {
            font-size: 0.75rem;
            height: 2rem;
            padding-left: 0.75rem;
            padding-right: 0.75rem;
            border-radius: 0.375rem
        }
    }
}

Improvements

export default {
-    syntaxes: { ... }
+    rules: { ... }
}
  • Rename the overly generic config.styles to config.components @1aron 5be593c
export default {
-    styles: { ... }
+    components: { ... }
}
React
  • Enhance config resolution and lifecycle management @1aron c027f5f
  • Optimize CSSRuntimeProvider for improved performance @1aron 1b7eebe
  • Prevent the initial secondary rendering of properties @1aron 1577fe9
Runtime
  • Prevent multiple RuntimeCSS instances for the same root element @1aron dc1ec35
Svelte
  • Refactor CSSRuntimeProvider for better config handling and lifecycle management @1aron 289a2b9
Vue
  • Enhance config resolution and lifecycle management @1aron b1492d7

Bug Fixes

Documentation

  • Add initial test cases and templates for CSS cascade layers @1aron 0026939
  • Add installation instructions for @master/normal.css package @1aron f0b26bf
  • Add note on native CSS cascade layers support in browser compatibility guide @1aron b320fc4
  • Revise styles guide with an overview and new examples for abstract styles @1aron bb9f55b
  • Update button class names to use rounded variants for consistency @1aron cee6213
  • Update descriptions for layers and enhance summary in cascade layers guide @1aron 2a44c30

v2.0.0-rc.47

19 Dec 17:57
Compare
Choose a tag to compare
v2.0.0-rc.47 Pre-release
Pre-release

Bug Fixes

Explore Config

v2.0.0-rc.46

17 Dec 18:09
Compare
Choose a tag to compare
v2.0.0-rc.46 Pre-release
Pre-release

New Features

  • Support ESLint v9 and flat configuration @1aron f0c83a4

    // eslint.config.js
    import css from '@master/eslint-config-css'
    
    export default [
        css
    ]

Additions

ESLint
  • Automatically load master.css.* configuration based on the current working directory @1aron 1578d11

    // before
    import { fileURLToPath } from 'node:url'
    import css from '@master/eslint-config-css'
    
    export default [
        css,
        {
            settings: {
                '@master/css': {
                    config: fileURLToPath(new URL('master.css', import.meta.url))
                }
            }
        }
    ]
    // after
    import css from '@master/eslint-config-css'
    
    export default [
        css
    ]

    You can still manually specify master.css.js if it is not in the current working directory.

Extractor
  • Exclusions for .next, .nuxt, and .svelte-kit directories in options @1aron 070fbb9

Improvements

ESLint
  • Import css from @master/eslint-config-css instead of @master/eslint-config-css/flat @1aron 5656195

    // eslint.config.js
    - import css from '@master/eslint-config-css/flat'
    + import css from '@master/eslint-config-css'
    
    export default [
        css
    ]
  • Use plugin:@master/css/legacy instead of @master/css @1aron ac85723

    /** @type {import('eslint').Linter.LegacyConfig} */
    module.exports = {
        extends: [
    -        'plugin:@master/css',
    +        'plugin:@master/css/legacy',
        ]
    }
Extractor Vite
  • Exclude CSS files from being processed in CSSExtractorPlugin transform @1aron cb5fec8

Bug Fixes

Extractor Vite

Upgrades

Examples

v2.0.0-rc.45

06 Aug 07:04
Compare
Choose a tag to compare
v2.0.0-rc.45 Pre-release
Pre-release

Bug Fixes

v2.0.0-rc.44

05 Jul 07:51
Compare
Choose a tag to compare
v2.0.0-rc.44 Pre-release
Pre-release

Additions

v2.0.0-rc.43

20 Jun 15:38
Compare
Choose a tag to compare
v2.0.0-rc.43 Pre-release
Pre-release

Additions

v2.0.0-rc.42

18 Jun 01:00
Compare
Choose a tag to compare
v2.0.0-rc.42 Pre-release
Pre-release

New Features

  • defaultMode config option, resolved #357 @1aron 5d07398 #357

    Default light mode

    // master.css.js
    export default {
        defaultMode: 'light' // default
    }

    Generated CSS:

    .light, :root {
        --primary: 0 0 0;
    }

    Now using variables with theme mode such as fg:blue does not require adding html.light in advance.

    -<html class="light">
    +<html>

    If your application supports light/dark, html.light is still required. This change mainly improves the startup experience of projects without theme mode.

    No default mode

    // master.css.js
    export default {
        defaultMode: false
    }

    Generated CSS:

    .light {
        --primary: 0 0 0;
    }

Bug Fixes

v2.0.0-rc.41

16 Jun 19:14
Compare
Choose a tag to compare
v2.0.0-rc.41 Pre-release
Pre-release
export default {
-    rules: {}
+    syntaxes: {}
}

Additions

Improvements

Bug Fixes

Extractor Vite

Documentation

v2.0.0-rc.40

27 May 15:00
Compare
Choose a tag to compare
v2.0.0-rc.40 Pre-release
Pre-release

Performance Upgrades

  • Fixed extending preset configurations repeatedly @1aron 5e79fc6

Improvements

  • Rename config.queries to config.at @1aron 361968f
    export default {
    -    queries: { ... }
    +    at: { ... }
    }
  • Responsive breakpoints are automatically derived from variables.screen @1aron a71e1ca

Documentation

v2.0.0-rc.39

21 May 15:35
Compare
Choose a tag to compare
v2.0.0-rc.39 Pre-release
Pre-release

Bug Fixes

ESLint
Language Server
  • An error should not be thrown if the external file does not have a corresponding workspace @1aron aa9c3ed

Tests

Language Server