v0.100.0
Minor Changes
-
#960
d89a036eThanks @tenphi! - Add@propertiessupport for defining CSS@propertyat-rules in tasty styles.New features:
- Define CSS custom properties with
@propertiesin styles using token syntax ($name,#name) - Color tokens (
#name) auto-setsyntax: '<color>'and defaultinitialValue: 'transparent' - Double-prefix syntax (
$name,##name) for referencing property names in transitions and animations useProperty()hook andinjector.property()now accept token syntax- Global properties can be configured via
configure({ properties: {...} })
Example:
// Global properties (optional) configure({ properties: { $rotation: { syntax: "<angle>", initialValue: "0deg" }, }, }); // Local properties in styles const Component = tasty({ styles: { "@properties": { $scale: { syntax: "<number>", initialValue: 1 }, "#accent": { initialValue: "purple" }, // syntax: '<color>' auto-set }, transform: "rotate($rotation) scale($scale)", transition: "$rotation 0.3s, $scale 0.2s", // outputs: --rotation 0.3s, --scale 0.2s }, });
- Define CSS custom properties with
-
#960
d89a036eThanks @tenphi! - Add color token support tofadestyle property. You can now specify custom transparent and opaque colors for the gradient mask, and use multiple comma-separated groups to apply different colors per direction.Add multi-group support to
borderstyle property. Multiple comma-separated groups allow cascading border definitions where later groups override earlier ones for conflicting directions (e.g.,border="1bw #red, 2bw #blue top"). -
#962
09db7beeThanks @tenphi! - Improve background style handling in Tasty. Addimagestyle for background images. Thefillhandler now supports all background CSS properties (backgroundPosition,backgroundSize,backgroundRepeat,backgroundAttachment,backgroundOrigin,backgroundClip). Addbackgroundandimagetransition semantic names. DeprecatebackgroundColor,backgroundImage, andbackgroundstyles in favor offill,image, and separate background properties. -
#960
d89a036eThanks @tenphi! - AddeduseKeyframesandusePropertyReact hooks for declarative CSS @Keyframes and @Property definitions. These hooks follow the same patterns as existing hooks likeuseStylesanduseRawCSS, usinguseInsertionEffectfor proper style injection and cleanup. -
#963
290cfa6cThanks @tenphi! - Breaking: Changedoutlinestyle syntax to use slash separator for offset:outline: '2px solid #red / 4px'instead of the previous space-separated format. Also addedoutlineOffsetas a direct style prop. -
#963
290cfa6cThanks @tenphi! - Added slash separator support in style parser. Style values can now use/surrounded by whitespace to define parts (e.g.,'ellipsis / 3','2px solid #red / 4px'). Each part is available viagroups[n].partsarray for style handlers. -
#960
d89a036eThanks @tenphi! - AddedTabscomponent for organizing content into multiple panels with full accessibility support via React Aria. The component supports multiple visual styles (default, panel, radio), tab deletion, inline title editing, lazy rendering with content caching, and proper integration with Layout components for stretching panels to fill remaining space. -
#963
290cfa6cThanks @tenphi! - Breaking: EnhancedtextOverflowstyle handler with automatic setup for text truncation. Previously,textOverflow: 'ellipsis'only settext-overflow: ellipsis(which doesn't work withoutoverflow: hidden). Now it automatically addsoverflow: hiddenandwhite-space: nowrapfor single-line ellipsis, making it actually functional.New features:
textOverflow: 'ellipsis'- single-line truncation with ellipsis (now works correctly)textOverflow: 'ellipsis / 3'- multi-line truncation (3 lines) with-webkit-line-clamptextOverflow: 'clip'- single-line clip withoverflow: hidden
The
displayStylehandler now managesdisplay,hide,textOverflow,overflow, andwhiteSpacetogether. User-providedoverflowandwhiteSpacevalues take precedence over auto-generated ones fromtextOverflow. -
#958
22e0adc7Thanks @tenphi! - ### Added- Predefined tokens in
configure(): Define reusable tokens ($namefor values,#namefor colors) that are replaced during style parsing. Unlike component-leveltokensprop, predefined tokens are baked into the generated CSS for better performance and consistency.
configure({ tokens: { $spacing: "2x", "$card-padding": "4x", "#accent": "#purple", }, }); // Use in styles - tokens are replaced at parse time const Card = tasty({ styles: { padding: "$card-padding", // → calc(4 * var(--gap)) fill: "#accent", // → var(--purple-color) }, });
- Plugins can now provide predefined tokens via the
tokensproperty inTastyPlugin.
- Predefined tokens in
Patch Changes
-
#963
290cfa6cThanks @tenphi! - Aligned babel plugin configuration interface with runtimeTastyConfig. TheTastyZeroConfignow supportspluginsandparserCacheSizeoptions, and uses the sharedconfigure()function internally. -
#963
290cfa6cThanks @tenphi! - Reorganized internal style chunk definitions. Display-related styles (display,hide,textOverflow,overflow,whiteSpace,scrollbar) are now in a DISPLAY chunk. Layout styles (flow,gap, grid/flex properties) are in a separate LAYOUT chunk. -
#963
290cfa6cThanks @tenphi! - Consolidated style handlers to reduce redundant handler registrations:widthStylenow handlesminWidth,maxWidthdirectlyheightStylenow handlesminHeight,maxHeightdirectlypresetStylenow handles all typography props (fontSize,lineHeight,fontWeight,letterSpacing,textTransform,fontStyle,fontFamily,font) with or withoutpresetdefined
Font props support number values:
fontSize={14}→font-size: 14px,fontWeight={700}→font-weight: 700.The
fontprop has special handling:font="monospace"→var(--monospace-font),font={true}→var(--font),font="CustomFont"→CustomFont, var(--font). ThefontFamilyprop is a direct value without fallback. -
#959
ed477654Thanks @tenphi! - Add custom style handlers API viaconfigure()and plugins. Handlers transform style properties into CSS declarations and replace built-in handlers for the same style name. ExportstyleHandlersobject for delegating to built-in behavior when extending. -
#961
46e84833Thanks @tenphi! - Fix FilterListBox custom value styles not appearing until hover and leaking to other items after filter is cleared. The issue was caused by ListBox virtualization using index-based keys instead of actual item keys, causing React to incorrectly reuse DOM elements. AddedgetItemKeyto the virtualizer to use actual item keys for proper DOM reconciliation.Additionally, when
allowsCustomValueis enabled and there are filtered items visible, the custom value option is now visually separated from the filtered results using a section divider. The visibility check for filtered items now also considers previously-added custom values, ensuring the separator is shown when a search term matches an existing custom item. -
#963
290cfa6cThanks @tenphi! - Refactoredinsetstyle handler with smart output strategy:- When using the
insetprop orinsetBlock/insetInlineprops: outputsinsetCSS shorthand for efficiency - When using individual
top,right,bottom,leftprops: outputs individual CSS properties to allow proper CSS cascade with modifiers
This fix resolves an issue where conditional modifiers on individual direction props (e.g.,
top: { '': 0, 'side=bottom': 'initial' }) would incorrectly override all four directions instead of just the specified one. - When using the
-
#959
ed477654Thanks @tenphi! - Fix ListBox item styles not being applied when passed via<ListBox.Item styles={...}>. Item-level styles are now properly merged with parent styles usingmergeStyles. -
#949
69c96a34Thanks @tenphi! - ### Added- Raw unit calculation: Custom units with raw CSS values (e.g.,
8px) are now calculated directly instead of usingcalc(), producing cleaner CSS output. - Recursive unit resolution: Units can reference other custom units with automatic resolution (e.g.,
{ x: '8px', y: '2x' }→1y=16px).
Removed
- Units
rp,gp, andsphave been removed from default units.
- Raw unit calculation: Custom units with raw CSS values (e.g.,
-
#960
d89a036eThanks @tenphi! - Fixed variant switching causing DOM element recreation. Components withvariantsnow preserve their DOM element and state when thevariantprop changes. -
#960
d89a036eThanks @tenphi! - AddedpreserveActionsSpaceprop to Item component. When used withshowActionsOnHover={true}, this prop prevents content shift by keeping the actions area at full width and only changing opacity on hover.