Releases: lxsmnsyc/solid-styled
Releases · lxsmnsyc/solid-styled
v0.10.0
<style jsx global>now has a different behavior- When provided with dynamic values, previously it would be included to the scoped variables, which is "counter-intuitive" towards its behavior. Now, the dynamic variables are now inserted directly to the document (in CSS, this would be
:root. The new behavior is also SSR-friendly, as the variables are generated with:rootstyle and inserted alongside the accompanied style sheet. - Internally, this introduces a new primitive called
useSolidStyledGlobal. - Fixes #28
- Since
:globaland@globalare still declared in a "local sheet", their behavior will remain as-is. In the future, this behavior might be fixed for consistency.
- When provided with dynamic values, previously it would be included to the scoped variables, which is "counter-intuitive" towards its behavior. Now, the dynamic variables are now inserted directly to the document (in CSS, this would be
- Fix vars declaration to only generate if there's actually any dynamic styles.
- Fix
@global(Fixes #18)
v0.9.0
PostCSS Preprocessing
- This release adds PostCSS for processing the CSS templates. You can check the following plugins, that are used by default, for the features that are supported:
- Autoprefixer
postcss-nested- CSSNano
In the future,solid-styledcan possibly allow to load the PostCSS config and to allow other plugins to be used.
- Fix
use:solid-styledtype to be inJSX.IntrinsicAttributes
v0.7.1
v0.7.0
- Move
babel-plugin-solid-styledtosolid-styled/babel - Add support for namespace import (i.e.
solidStyled.css) - Fix scoping attributes from
data-s-*tos:* - Fix support for multiple roots and allow optional use of
StyleRegistryon client-side. - Fix
<style jsx>to outputJSXTextinstead ofJSXFragment(due to Solid throwing an error for non-top-level fragments). - Fix style merging when style is nullish.
Credits to @zaydek for spotting most of the issues
v0.6.0
- Fix hash generation to support out-of-order file loading, drop
modeoption and addsourceoption.- Previously, solid-styled used a sequential hash algorithm however it naively assumed that files are loaded in the same order as they are in different context (i.e. server vs client). The new hash generation produces a base hash from the file path (either through
sourceoption or automatically by Babel) and then produces a sequential id appended to the base hash.
- Previously, solid-styled used a sequential hash algorithm however it naively assumed that files are loaded in the same order as they are in different context (i.e. server vs client). The new hash generation produces a base hash from the file path (either through
v0.5.1
v0.5.0
v0.4.0
- Add support for
prefix.- This is useful for when authoring packages that uses
solid-styled.
- This is useful for when authoring packages that uses
- Rework id generation and add
ssroption.- Previously,
solid-styledusesnanoidfor ID generation. However,nanoidisn't deterministic and sequential, so ifsolid-styledis used for SSR purposes where it is common to output two or more separate bundles, id generation will be inconsistent. The new id generation uses PostgreSQL' pseudo_encrypt, which produces consistent ID values that looks random but isn't. The newssroption would allowsolid-styledto know which instance of the id generation would be used to allow continuation.
- Previously,
v0.3.0
- Add
<style jsx>and<style jsx global>. It's inspired bystyled-jsxand functions similarly tocss.
function Button() {
const [color, setColor] = createSignal('red');
return (
<>
<style jsx>
{`
button {
color: ${color()};
}
`}
</style>
<button onClick={() => {
setColor((c) => (c === 'red' ? 'blue' : 'red'));
}}>
Current color: {color()}
</button>
</>
);
}- Fix styles to no longer rely on component IDs and using an internal effect for style patching, instead, it compiles to
styleprop and attempts style merging (if user provides one). This also improves support for SSR. - Fix callbacks inside functions where
cssis declared to be affected by scoping. This allows components like<Show>and<For>to be scoped properly.