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 visible (Hide)

packages - v0.5.17

Published by Machy8 over 1 year ago

packages - v0.5.16

Published by Machy8 almost 2 years ago

Bugfixes + Typehint fixes

Full Changelog: https://github.com/stylify/packages/compare/v0.5.15...v0.5.16

packages - v0.5.15

Published by Machy8 almost 2 years ago

External variables feature

When some external variables are defined (for example CSS variables) it makes no sense to define or import them into Stylify. Instead you can use mark them as external. More info in docs.

const stylifyConfig = {
 compiler: {
  externalVariables: [
     // Simple string check
     'test',
     // Flexible function check. Return true if matched. Otherwise return undefined or nothing.
     (variable) => {
       if (variable.startsWith('md-') return true;
     }
  ]
 }
}

Full Changelog: https://github.com/stylify/packages/compare/v0.5.14...v0.5.15

packages - v0.5.14

Published by Machy8 almost 2 years ago

  • Fixed watching for directories with special characters.
  • Used chokidar for watching directories instead of fs.watch, because the watching system is simply a huge mess.

Full Changelog: https://github.com/stylify/packages/compare/v0.5.13...v0.5.14

packages - v0.5.13

Published by Machy8 almost 2 years ago

  • Fix: Bundler: Already normalized path should not be normalized again

Full Changelog: https://github.com/stylify/packages/compare/v0.5.12...v0.5.13

packages - v0.5.12

Published by Machy8 almost 2 years ago

Features

Now you can define Dynamic Components.
With this feature, you can create components, that changes style based on matches from regular expression

For example:

title--large title--$red

const compilerConfig = {
    components: {
        // title--$red
        // title--#06f
        'title(?:--(\\S+))?': ({ matches, variables, helpers, dev }) => {
            const color = matches[1] ?? '#000';
            return `font-size:24px${color ? ` color:${color}` : ''}`;
        },
    }
}; 

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.11...v0.5.12

packages - v0.5.11

Published by Machy8 almost 2 years ago

Features

  • Added screen and pseudo classes group md:{font-size:24px;margin-bottom:8px} lg:hover:{color:purple;scale:1.4}
  • Utilities, that are not matched within a content are not generated even though they have been added within component or custom selector
  • Removed unnecessary escaping of - and _ in generated CSS
  • Characters aliases such as _ can be now escaped \_, so the _ is preserved: [.some\_\_selector]{color:blue} => this will not replace underscores

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.10...v0.5.11

packages - v0.5.10

Published by Machy8 almost 2 years ago

packages - v0.5.9

Published by Machy8 almost 2 years ago

  • Bug fixes in Bundler watch task

Full Changelog: https://github.com/stylify/packages/compare/v0.5.8...v0.5.9

packages - v0.5.8

Published by Machy8 almost 2 years ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.7...v0.5.8

packages - v0.5.7

Published by Machy8 almost 2 years ago

What's Changed

  • Bundler can now watch newly added files, no restart is required
  • Bundler can export CSS into CSS layers
  • Fixed bug: Astro supports multiple files
  • Unplugin can now be initialized without config or empty brackets
  • Astro now doesn't mangle selectors in source files but in generated js
  • Tunning9 by @Machy8 in https://github.com/stylify/packages/pull/156

Full Changelog: https://github.com/stylify/packages/compare/v0.5.6...v0.5.7

packages - v0.5.6

Published by Machy8 almost 2 years ago

What's Changed

  • Unplugin (any type) can now load config without empty configuration object: stylifyVite({}) => stylifyVite()

Full Changelog: https://github.com/stylify/packages/compare/v0.5.5...v0.5.6

packages - v0.5.5

Published by Machy8 almost 2 years ago

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.4...v0.5.5

packages - v0.5.4

Published by Machy8 almost 2 years ago

  • Bug fixes
  • Unplugin now have a shared bundler called default
  • Each plugin can then have an id. This will create it's own bundler and compiler for rewritting selectors.

What's Changed

packages - v0.5.3

Published by Machy8 almost 2 years ago

  • Bugfixes
  • Lerna publish remains for publishing. Yarn workspaces work somehow weirdly when publishing packages.

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.5.2...v0.5.3

packages - v0.5.2

Published by Machy8 almost 2 years ago

packages - v0.5.1

Published by Machy8 about 2 years ago

  • Unplugin configuration can be overriden

Full Changelog: https://github.com/stylify/packages/compare/v0.5.0...v0.5.1

packages - v0.5.0

Published by Machy8 about 2 years ago

@stylify/stylify

  • Plain Selectors renamed to Custom selectors
  • Components and custom selectors now accepts only string instead of an array of strings and etc.
  • Components and custom selectors can have nested selectors
const components = {
   'button': `
      cursor:pointer
      .icon { color:yellow }
      > {
      .icon, span { vertical-align:middle }
      }
  `
}
  • Custom selectors can be generated directly from selector within the markup
  • Stylify packages now use hookable system instead of properties and configurations
  • Runtime now uses Hookable system, instead of dom custom event
  • Rewrite selectors method now doesn't need compilation result because it uses the MinifiedSelectorsGenerator register.
  • Macro functions now receive one object without changing this object:
'macro': ({ macroMatch, selectorProperties, helpers, variables, dev }) => {
  // ...
}
  • The Rewrite Selectors method now accepts an object instead of two arguments or a string.
.rewriteSelectors({ content, rewriteOnlyInSelectorsAreas, matchSelectorsWithPrefix })
  • The Rewrite Selectors method now accepts a new argument: matchSelectorsWithPrefix that causes to match element according to the given prefix during compilation => If matched selector had to be class, the prefix is . and is rewritten as .selector instead of selector.
  • The Minified Selectors Generator now returns a character with prefix if defined.

@stylify/bundler

  • When waiting on the Bundler to process, the await bundler.waitOnBundlesProcessed() can be called on its own. It now internally waits on the bundle() method to finish. The await bundler.bundle(). Can be removed if is used to wait on the Bundler before another step in the build.
  • When generated or rewritten content is the same as in the file, that file is not overridden. This decreases the amount of "file saved" triggers during development. If the file doesn't exist, it is created.

@stylify/unplugin

  • Transform method is triggered only when selectors are rewritten. Otherwise, it just returns code that was passed as argument
  • When a new config is passed, the getBundler() method now waits on the previous bundler to finish and then creates a new bundler during development

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.4.0...v0.5.0

packages - v0.4.0

Published by Machy8 about 2 years ago

@stylify/astro

  • stylifyIntegration export renamed to stylify.
  • There is no config nor empty object necessary when initializing the integration
  • Selectors are now matched within class:list.

@stylify/stylify

  • One underscore for a selector instead of two: _ => border:2px_solid_red.
  • Helpers now works even when replaceVariablesByCssVariables is enabled.

What's Changed

Full Changelog: https://github.com/stylify/packages/compare/v0.3.0...v0.4.0

packages - v0.3.0

Published by Machy8 about 2 years ago

News and features

  • Native preset is now by default in Compiler. No need to load it anymore
  • Variables can be now added under classes
const compilerConfig = {
  variables: {
     '.dark': {
        bg: '#000'
     }
  }
}
  • Helpers like lighten(#000,10) can now be used by default in selectors properties border:2px__solid__lighten(#000,10), color:lighten(#000, 10).
  • Extend keyword removed. The configuration is now merged and not overridden by default.
  • Selector areas for React, Vue, Angular, Nette, Lit and Alpine added directly into the compiler.
  • Unplugin exports fixed
  • Runtime now has only Stylify.configure() without runtime key.
  • A few bugfixes - Runtime, Replacement of $ in ignored area

Packages

  • Added @stylify/astro integration for AstroJS
  • @stylify/autoprefixer discontinued

What's Changed

New Contributors

Full Changelog: https://github.com/stylify/packages/compare/v0.2.1...v0.3.0