packages

💎 Monorepository for Stylify packages. Stylify uses CSS-like selectors to generate Extremely optimized utility-first CSS dynamically based on what you write 💎.

MIT License

Downloads
323
Stars
426
Committers
5

Bot releases are hidden (Show)

packages - v0.7.0 Latest Release

Published by Machy8 6 months ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.6.2...v0.7.0

A big thanks goes to alirq for a sponsorship.

packages - v0.6.2

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.6.1...v0.6.2

packages - v0.6.1

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.6...v0.6.1

packages - v0.6

Published by Machy8 over 1 year ago

What's Changed

@stylify/stylify

Compiler

  • return this was removed from configure and addMacro method
  • Css variables are now enabled by default and all variables are now exported as CSS variables. Also when used within a a property value as $someVariable it is converted to var(--someVariable).
  • replaceVariablesByCssVariables was renamed to cssVariablesEnabled. The cssVariablesEnabled option accepts a boolean value that disables CSS variables if the false value is passed as value.
  • selectorsAreas now expect regular expressions instead of strings
// 0.5
const compilerConfig = {
  selectorsAreas: [
	'(?:^|\\s+)class="([^"]+)"',
  ]
}

// 0.6
const compilerConfig = {
  selectorsAreas: [
	/(?:^|\s+)class="([^"]+)"/,
  ]
}

Macros

  • The this object within the macro callback now contains the compiler instance
  • Instead of selectorProperties.add() return an object with properties: values
  • Matches getCapture() method now returns undefined for a default value if capture was not found instead of empty string. This improves comparison for macroMatch.getCapture(0) ??
  • hasCapture method has been removed
// 0.5
const compilerConfig = {
 macros: {
   macro: ({ macroMatch, selectorProperties, helpers, variables, dev })  => {
     selectorProperties.add('property', macroMatch.geCapture(0));
   }
 }
}

// 0.6
const compilerConfig = {
 macros: {
   macro(match) {
      const { variables, helpers, dev } = this;
      return  { 
        ['property']: match.getCapture(0),
        'another-property': 'value'
      }
   }
 }
}

Components

  • The this object within the component callback now contains the compiler instance
  • Component definition now receives RegExpMatch instead of an array of matches. Instead of matches[0] use getCapture(0). Matches indexes are now shorter by 1: the fullMatch is the whole reg exp match, and captures contain only additional captures:
    • matches[0] => match.fullMatch
    • matches[1] is now match.getCapture(0)
// 0.5
const compilerConfig = {
  components: {
     'btn:(\\S+)'(match) {
        const { variables, helpers, dev } = this;
        return `color:${match.getCapture(0)}`
     }
  }
}

Helpers

  • The this object within the helper callback now contains the compiler instance

Configurator

  • All methods except getExistingConfigFiles were removed. This method returns paths to existing config files.

Compiler hooks

  • compiler:newMacroMatch: Now receives Record<string, string> instead of SelectorProperties object

@stylify/bundler

  • cssVarsDirPath, sassVarsDirPath, lessVarsDirPath, stylusVarsDirPath were renamed to cssVarsExportPath, sassVarsExportPath, lessVarsExportPath, stylusVarsExportPath. It accepts direct file path (like ./path/to/vars.css) to which it will be saved, or only a directoy path ./path/to/cssDir. If no file name is provided, the stylify-variables file name will be used with correct suffix.
packages - v0.5.33

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.32...v0.5.33

packages - v0.5.32

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.31...v0.5.32

packages - v0.5.31

Published by Machy8 over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/stylify/packages/compare/v0.5.30...v0.5.31

packages - v0.5.30

Published by Machy8 over 1 year ago

packages - v0.5.29

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.28...v0.5.29

packages - v0.5.28

Published by Machy8 over 1 year ago

What's Changed

Stylify

  • Indented CSS variable in generated CSS

Bundler

  • Config hot reloading
  • Added restart method
  • Normalized output file path

Astro

  • Fixed Windows build

Nuxt Module

  • Fixed Windows build

Nuxt

  • Fixed Windows build
  • Fixed mangled selectors rewriting in content module

Unplugin

  • Added yaml, neon, mdx file formats
  • Fixed ignored areas matching
  • Fixed duplicated bundler instances

Full Changelog: https://github.com/stylify/packages/compare/v0.5.27...v0.5.28

packages - v0.5.27

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.26...v0.5.27

packages - v0.5.26

Published by Machy8 over 1 year ago

Fixes of duplicated areas mangling

Full Changelog: https://github.com/stylify/packages/compare/v0.5.25...v0.5.26

packages - v0.5.25

Published by Machy8 over 1 year ago

What's Changed

  • mangledSelectorsPrefix and selectorsPrefix can be used to prevent collision with already existing selectors
  • Mangled blocks are without new lines and duplicated spaces. This makes the output look prettier.
  • Mangling can handle escaped areas for example within yaml files

Full Changelog: https://github.com/stylify/packages/compare/v0.5.24...v0.5.25

packages - v0.5.24

Published by Machy8 over 1 year ago

  • Fixed cached results reset in Stylify Compiler.
  • Added stop method in the Bundler.

Full Changelog: https://github.com/stylify/packages/compare/v0.5.23...v0.5.24

packages - v0.5.23

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.22...v0.5.23

packages - v0.5.22

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.21...v0.5.22

packages - v0.5.21

Published by Machy8 over 1 year ago

packages - v0.5.20

Published by Machy8 over 1 year ago

  • Bug fixes in Stylify Cache

Full Changelog: https://github.com/stylify/packages/compare/v0.5.19...v0.5.20

packages - v0.5.19

Published by Machy8 over 1 year ago

packages - v0.5.18

Published by Machy8 over 1 year ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.17...v0.5.18

Package Rankings
Top 5.62% on Npmjs.org
Badges
Extracted from project README
bundler-status stylify-status