Skip to content

Releases: Jarzka/stylefy

3.2.0

13 Jun 16:01
8e465fb
Compare
Choose a tag to compare
  • ::stylefy/media and ::stylefy/supports can now be defined using vector syntax. This is useful if the order of the rules matter in CSS.
  • All stylefy's special keywords now work inside stylefy/supports style map (manual mode and scoping were previously missing)

3.1.0

07 Jun 14:46
4bed475
Compare
Choose a tag to compare
  • Adds a new feature: ::stylefy/scope, which can be used to define styles that are applied only when the current
    element is in some specific scope. See README.md for more info.

3.0.0

16 Apr 14:00
ed05307
Compare
Choose a tag to compare

April 9, 2021

  • stylefy.impl.dom, which handles DOM manipulation when using styles in components, has been (mostly) removed and replaced with external modules. This change frees stylefy from depending on Reagent, which makes it possible to support many UI libraries / frameworks. At the beginning, three different modules are available:
    • stylefy/reagent, which is essentially stylefy.impl.dom that was shipped in previous versions.
    • stylefy/rum, which is functionally the same module as stylefy/reagent, but for Rum.
    • stylefy/generic-dom is a general-purpose solution that does not depend on any specific UI library / framework. It makes only synchronous DOM updates, so the wide support comes with the cost of performance.
  • Namespaced keywords are replaced with unnamespaced when caching CSS. This makes different module implementations easier to work with, and it also reduces the size of the cache by approximately 7%. Unsupported cache versions are cleared automatically, so no actions are required from the users of the library.
    • This also means that after upgrading stylefy to version 3.0.0, you should not downgrade it, or the cache is going to get corrupted! (if you absolutely must downgrade, turn caching off)
  • Style hashing now checks Garden units recursively. This makes sure that if Garden units are used deeply inside a style map, they are converted to CSS before hashing, so that the hash values are the same on both frontend and backend. This can cause changes in some autogenerated class names.
  • A warning message about namespace conflict between stylefy/class and clojure.core/class is now ignored.

Migration guide from previous versions (frontend only):

Assuming you are using Reagent, update stylefy version and add stylefy/reagent as a new dependency. Your dependencies should look something like this:

[stylefy "3.0.0"]
[stylefy/reagent "3.0.0"]

Require stylefy.reagent and initialise it together with stylefy (along with any other options you pass to stylefy/init):

(:require [stylefy.reagent :as stylefy-reagent])

(stylefy/init {:dom (stylefy-reagent/init)})

That's it!

2.2.2

20 Mar 18:57
Compare
Choose a tag to compare
  • Minor refactoring based on clj-kondo findings. No functional changes.

PR: #54

2.2.1

15 Jun 15:39
Compare
Choose a tag to compare
  • Fix Figwheel warning

2.2.0

31 May 08:21
Compare
Choose a tag to compare
  • Make sure that keyframes, font-face, tag, class and prepare-styles always return nil, as the return value was never designed to be used anywhere.

2.1.1

30 May 19:25
Compare
Choose a tag to compare
  • Fix tests

2.1.0

30 May 19:06
Compare
Choose a tag to compare
  • Adds support for calling keyframes, font-face, tag and class on the backend.

2.0.0

30 May 14:17
d2b33d8
Compare
Choose a tag to compare
  • BREAKING Removes the possibility to pass ::stylefy/with-classes to use-style via options map (second argument of use-style). If you do this, a warning message is logged and the value is ignored. This feature has been marked as deprecated since version 1.3.0 (2018). If you have used ::stylefy/with-classes in options map, you can easily replace it with :class. Notice that passing ::stylefy/with-classes via style map (first argument of use-style) is still perfectly valid, this change is only related to the options map.
  • :class in HTML attributes and :stylefy.core/with-classes in style map now support additional syntax: you can pass a string, a keyword or a vector of strings or keywords. You can also pass a vector of both keywords and strings if you wish. nil is also accepted and it will be ignored. Discussion: #44
  • Adds basic support for Server-Side Rendering (SSR). This means that we can now use use-style on the backend, when generating Hiccup code. This new feature does not affect how you use stylefy on the frontend. If you don't need SSR, you can simply omit it by doing nothing.

1.14.1

25 Mar 17:37
Compare
Choose a tag to compare
  • Fix a bug: style maps with Garden units were sometimes hashed incorrectly (thanks to @frankitox for reporting this: #21 (comment))
  • Minor refactoring

If you have used stylefy's auto-generated class names in tests, you can expect the values of those tests to change.