Releases: ghivert/sketch
v4.0.0
What's Changed — Core
v4.0.0 marks a major release for Sketch! It bundles new improvements, new
features, and improved namespacing! Six months after the initial release of v3,
v4 marks a new milestone as Sketch gains in maturity, usability and usage. More
and more people are using it, and as such, Sketch has to evolve in the right
path!
Every functions now display documentation, and points to according MDN
documentation, with no defaults for a language. This means Sketch tries to help
you with precise, up to date documentation extracts, and let you deep dive in
the documentation in your favourite language with one click!
Thanks to everyone using Sketch and helping me maintaining it as a package,
always pushing the boundaries of what can be achieved with it!
Features
- Most selectors have been implemented. Some selectors are still missing, when
they were overlapping with Gleam, hard to implement, or simply useless to
implement (like:host
that should be used in plain CSS stylesheets mostly). - Most combinators have been implemented. They can be used exclusively with
other classes and I have no will to support anything else. If you need
specific CSS, then you probably need to write CSS. - Support for
only
,print
,screen
&all
media queries has been added. - CSS transform functions are now fully supported, with all functions supported.
- CSS Length are now fully supported, with all length types supported.
- Keyframes
@rule
are now supported. - Font Face
@rule
are now supported.
Improvements
- Every CSS property, selectors & combinators now live in
sketch/css
. - Every other modules, like
media
,size
orangle
now live insketch/css
. - Every CSS property now display the headline of the documentation, and points
to its MDN Reference. - Every CSS length now display the headline of the documentation, and points to
its MDN Reference. - Every CSS angle now display the headline of the documentation, and points to
its MDN Reference. - Every CSS media queries now display the headline of the documentation, and
points to its MDN Reference. - Every CSS transform now display the headline of the documentation, and points
to its MDN Reference. - Every CSS pseudo-classes & pseudo-elements now points to its MDN Reference and
have a fragment of the page to simplify understanding. - SVG exclusives properties has moved to
sketch/css/svg
. to_string
functions have been hidden from user in documentation. While they
remain publicly accessible, they are of small utility for the daily users.
Frontend authors can still use them if they need it.- Code has been simplified as a whole. Readability is better, codebase is easier
to understand. - Few tests are now implemented to ensure no regression across versions!
sketch.Cache
has been renamedsketch.StyleSheet
, and related function have
been updated accordingly.size
module is renamedlength
, to follow CSS specifications. All lengths
are also now implemented and supported.transform.translate2
andtransform.scale2
are deleted.
Bugfixes
- Nested selectors/combinators are now supported.
- Persistent class name generation strategy in caches have been removed to only
keep Ephemeral class name generation strategy. Persistent vs Ephemeral caches
are still there, but they now don't lead to different class names. One class
== one class name no matter the cache they're in.
What's Changed — Sketch CSS
Sketch CSS underwent a major rewrite. From a quick proof of concept drafted in a
day to illustrate the abilities of Sketch, Sketch CSS is now completely
reimplemented from scratch, with support for modern, up to date Gleam, with
partial supports for "code evaluation".
Sketch CSS now somewhat acts as an "interpreter". Instead of reading the code,
and generating the corresponding CSS, Sketch CSS now traverse the sources, and
execute some parts of the code, like an interpreter would do. This allows to
have an whole vision of the Gleam AST, but also to perform variable
interpretation, light computations, dependency detection, cyclic detection, and
more!
Sketch CSS marks the first real step of Sketch as a tool to generate CSS. New
adventures await, with support for Lustre devtools, Vite, and such!
Features
- Sketch CSS reads
*_styles.gleam
,*_css.gleam
&*_sketch.gleam
files to
generate CSS source files. - Sketch CSS configuration can be configured in CLI, with
sketch_css.toml
, or
directly ingleam.toml
.
What's Changed — Sketch Lustre
v2.0.0 marks a breaking change with the new Sketch release (i.e. v4.0.0). Sketch
Lustre now uses a new, more idiomatic render
and ssr
API, and simplifies as
much a possible the exposed API.
Sketch Lustre has been one of the principal package used in combination with
Lustre. Thanks for your investment!
Improvements
- Adapt to new Sketch API v4.0.0.
Cache
has been renamed toStyleSheet
, and
as such, can cause some inconsistencies bugs with old code. - Use a new middleware-render API. The old
compose
function is now not
supported anymore. - Remove the old
Options
in favour ofContainer
. - Shadow root management has been changed from
plinth
to simpleDynamic
.
This can't type-check it, but it avoid having to depend onplinth
in
production, to let every user handleShadowRoot
as they want. - Every HMTL element now has MDN Reference links & fragment of description to
explain how to use them.
What's Changed — Sketch Redraw
v2.0.0 marks a breaking change with the new Sketch release (i.e. v4.0.0). Sketch
Redraw should now be used in conjuction with redraw_dom
exclusively.
Improvements
- Every HMTL element now has MDN Reference links & fragment of description to
explain how to use them.
Full Changelog: v3.1.2...v4.0.0
v3.1.2
v3.1.1
What's Changed
- Bugfix - Fixes in CSS generation - "sketch_css" by @josevictorferreira in #29
- support updated lustre 4.6.0 by @Guria in #31
- Remove outdated documentation by @ghivert in #33
- Change way to use
sketch.compose
, to have a more consistent output.
New Contributors
- @josevictorferreira made their first contribution in #29
- @Guria made their first contribution in #31
Full Changelog: v3.1.0...v3.1.1
v3.1.0
v3.0.2
What's Changed
- Hide the Erlang target on JS. Fix bug where the JS target was not able to compile.
Full Changelog: v3.0.1...v3.0.2
v3.0.1
What's Changed
- fix:
size.percent_
returnPct
instead ofPx
by @kwshi in #22 - Add ephemeral caches on BEAM by @ghivert in #24. Sketch is now usable in the exact same way on the Erlang target as well as on the JS target.
New Contributors
Full Changelog: v3.0.0...v3.0.1
v3.0.0
3.0.0 — New Major Version 🎉
Sketch undergo a major rewrite, switching from being a Lustre-focused package, to a generic CSS-in-Gleam package. Sketch is now split across multiple packages: sketch
, sketch_css
& sketch_lustre
.
Inspired by Gleam, Sketch has now an agnostic core, able to target any project and any compile target, and has few packages specialised for frameworks and libraries to integrate it in a transparent way! This step starts first with the split of Lustre features from the core to its own package, sketch_lustre
. This change should help building on top of Sketch, and allow everyone to use the package, in the way they like. Sketch favours diversity!
Changes
- Deprecations are removed.
- Remove the mechanism of "virtual stylesheet", because browsers optimise for static CSS. Every class pushed in
Cache
is now memoised. - Add every possible non-experimental CSS properties.
- Split Lustre bits to
sketch_lustre
. sketch_css
allows to generate a CSS stylesheet from Sketch styles.- Class ID change from guess (with magic) to
string.inspect
(without magic, in a deterministic way). Overhead is really low (few milliseconds at most). sketch.Class
now contains its string representation, allowing for quicker lookup in cache.- Lustre mechanism switch from injecting styles in globalised
Cache
to an additional tree walk before render (likeelm-css
). This is transparent for the user, and should not be felt as a change anyway (time to render differs from a bunch of milliseconds).
Full Changelog: v2.3.0...v3.0.0
v2.3.0
What's Changed
- Add the utility functions in
sketch/lustre/element
to create easily view functions in Lustre, Sketch-enhanced!
Full Changelog: v2.2.2...v2.3.0
v2.2.2
v2.2.1
What's Changed
- Small bugfix on class name generation to push in the virtual stylesheet.
Full Changelog: v2.2.0...v2.2.1