Skip to content

Conversation

@tilucasoli
Copy link
Collaborator

Summary

Introduces TokenStyleMixin that provides a useToken method for resolving design tokens within styles.

Changes

  • New TokenStyleMixin: Provides the useToken method that enables context-aware design tokens (colors, spacing, etc.) to drive dynamic styling through a clean, composable API
  • Refactored VariantStyleMixin: Improved variant application architecture
  • Updated all Styler classes: Box, Flex, FlexBox, Icon, Image, Stack, StackBox, and Text now incorporate the new mixin
  • Code cleanup: Removed unused token-related code from value_tokens.dart and mix_token.dart
  • Variant utilities refactor: Better consistency in variant handling

Usage Example

BoxStyler()
  .useToken($primary, BoxStyler().color);

// Or with explicit builder:
BoxStyler()
  .useToken($primary, (color) => BoxStyler().color(color));

Tests

Added comprehensive tests in token_style_mixin_test.dart

- Introduce TokenStyleMixin that provides a useToken method for resolving
  design tokens within styles
- Refactor VariantStyleMixin to improve variant application architecture
- Update all Styler classes (Box, Flex, FlexBox, Icon, Image, Stack,
  StackBox, Text) to incorporate the new mixin
- Clean up unused token-related code from value_tokens.dart and mix_token.dart
- Refactor variant utilities for better consistency

This enables context-aware design tokens (colors, spacing, etc.) to drive
dynamic styling through a clean, composable API.
@vercel
Copy link
Contributor

vercel bot commented Jan 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
mix-docs Ready Ready Preview, Comment Jan 14, 2026 2:49am

@docs-page
Copy link

docs-page bot commented Jan 14, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/mix~830

Documentation is deployed and generated using docs.page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants