free-style

Make CSS easier and more maintainable by using JavaScript

MIT License

Downloads
242.4K
Stars
706
Committers
14

Bot releases are hidden (Show)

free-style - ES2015 Set and Map Latest Release

Published by blakeembrey 9 months ago

Improved

  • ES2015 set/map usage, removes a few bytes 3fe91cc

https://github.com/blakeembrey/free-style/compare/v5.0.0...v5.0.1

free-style - ESM only

Published by blakeembrey 9 months ago

Changed

Improvements

  • Shrunk the package 0.1kb (7% smaller).
  • Performance improved in large style benchmarks by ~5%.

Added

  • Added a compile API for pre-compiling styles to add to multiple sheets.
  • Added support for a custom prefix to create() so all styles can be namespaced in a single sheet.

https://github.com/blakeembrey/free-style/compare/v4.1.0...v5.0.0

free-style - Allow null and undefined in `PropertyValue`

Published by blakeembrey over 3 years ago

Changed

  • Allow null and undefined in PropertyValue f6b33f9
    • Primarily means that an array of values can now contain null and undefined and they will be filtered out as if they weren't set
free-style - Remove `register*` Methods

Published by blakeembrey over 4 years ago

Changed

  • Remove old register* methods b506c8b
    • Everything can be done using a singular registerStyle going forward, simplifies the API interface and removes even more bytes in production!
    • If you need to provide backward-compatible interfaces (e.g. you're a library wrapping free-style), the commit above shows how it backward compatibility was maintained in 3.x - you'll just need to implement it yourself now
    • The entire bundle of free-style is down to 1.7kB https://bundlephobia.com/[email protected]
free-style - Fix Nested Selector Hashing

Published by blakeembrey over 4 years ago

Fixed

  • Fix nested selectors returning the same hash when no other styles are present
    • E.g. { color: 'red' } and { '&:first-child': { color: 'red' } } should return different hashes, otherwise it'll create some nasty edge cases for the class name getting set to { color: 'red' } unexpectedly
free-style - Remove \0 From Strings

Published by blakeembrey over 4 years ago

Fixed

  • Remove \0 from internal hash strings
  • Use the internally generated hash for shorter IDs for conflict resolution
free-style - Publish ES5 Distribution

Published by blakeembrey over 4 years ago

Fixed

  • Add new dist.es5 directory to NPM files, left out of the previous release 😅
free-style - Add ES5 Distribution

Published by blakeembrey over 4 years ago

Added

  • Create an ES5 distribution available at free-style/dist.es5
free-style - Register Style For Everything

Published by blakeembrey over 4 years ago

Added

  • Allow registerStyle to handle every previous method in one function (e.g. registerHashRule, registerRule and registerCss)
    • This works by interpolating rules with & (e.g. @keyframes &), and adding a new flag $global: true
free-style - Even Smaller Build

Published by blakeembrey over 4 years ago

Changed

  • Move to ES2015 (saves 0.3kb)
  • Cosmetic code changes to shave a few extra bytes
free-style - Automatically strip `debug` in production

Published by blakeembrey almost 5 years ago

A bunch of small changes to reduce overall bundle size, which ultimately impacted backward compatibility.

Changed

  • Remove IS_UNIQUE and DISPLAY_NAME exports in favor of $unique and $displayName keys
  • Remove debug support in favor of process.env.NODE_ENV
    • This enables code stripping in production for Webpack and other bundlers and resulted in a 0.6kB bundle size reduction
  • Remove hash function customization
    • As far as I know no one has used it in production and it increases scope of the package (let me know if you are!)
free-style - DISPLAY_NAME style tags

Published by blakeembrey almost 5 years ago

Added

  • Support DISPLAY_NAME on style objects
  • Ignore any keys starting with an _
free-style - Reduce object creations during stylize

Published by blakeembrey over 5 years ago

Changed

  • Reduce one object creation per nested level of styles during stylization to internal object representation
free-style - Styles that fire together wire together

Published by blakeembrey over 5 years ago

Added

  • Keep styles that are registered at the same time together instead of de-duping
    • This should result in a more consistent cache order (based on first insertion instead of last), no re-ordering and no de-duping of partially registered styles
free-style - Expose `Cache#values`

Published by blakeembrey over 5 years ago

Added

  • Expose a function to get the list of values in the current cache ordered as it would be in the sheet output
free-style - CSS Numeric Properties

Published by blakeembrey over 6 years ago

Added

  • Add more CSS numeric properties to whitelist
free-style - Fix Overloaded Property Ordering

Published by blakeembrey almost 7 years ago

Fixed

free-style - Escape Display Name

Published by blakeembrey almost 7 years ago

Changed

  • Escape the display name in output CSS for special character support in class names
free-style - Minor Bump

Published by blakeembrey about 7 years ago

Improved

  • Custom string concatenation is faster than Array#join for the perf tests
  • Update hyphenate regexp matching to do less work
free-style - Speed-Up

Published by blakeembrey about 7 years ago

Improved

  • Internally manage styles via an array of strings instead of computing getStyles() on demand
  • Switch to Object.create(null) for cache maps