dacs 0.6.0
dacs: ^0.6.0 copied to clipboard
Tailwind-like utility classes for Flutter. Apply text styles, padding, margins, colors, and borders via concise string expressions.
0.6.0 #
- String-first design token configuration: added public
Dacs.configure(config: ...)support for app-defined colors, spacing, border radius, shadows, font families, font sizes, typography aliases, motion aliases, and semantic utility names without importing internal token files. - Configurable breakpoints: added
theme.screensandtheme.extend.screensso projects can replace or extend responsive variants while preserving deterministic compilation and compound variants. - Logical spacing and positioning: added RTL-aware
start/endutilities for padding, margin, and inset/position resolution while keeping existing physicalleft/rightutilities compatible. - Accessibility conditions: added high-contrast and motion-preference resolution through
DacsResolveContext,MediaQuery, and variants such ashigh-contrast:,motion-safe:,motion-reduce:, andmotion-disabled:. - Configurable typography and fonts: added configurable
fontFamily,fontSize, andtypographyentries, including fallback/package metadata for consumers that load fonts through Flutter assets, packages, or external loaders such asgoogle_fonts. - Stable motion output: added
DacsMotionSpec,.dMotion, and.dMotionOf(context)so adapters can consume resolved duration, curve, reverse duration, and reduced/disabled-motion behavior. - Arbitrary value policy: added
policy.arbitraryValues(allow,warn,reject) plus structured diagnostics for rejected or malformed[...]utilities. The default remains compatible and allows arbitrary values. - Static validation: added
dart run dacs:dacs analyzeandDacsValidator.validate(...)to detect invalid utility strings, rejected arbitrary values, malformed bracket syntax, and target-consumption warnings before UI execution. - Documentation and tests: updated README and docs for the new design-system configuration model, native Flutter font responsibilities, motion output, arbitrary-value policy, and static validation workflow.
0.5.0 #
- Material 3 theme expansion: added adapters and string extensions for
IconButtonThemeData,SegmentedButtonThemeData,BadgeThemeData,DrawerThemeData,BottomAppBarThemeData,NavigationRailThemeData,PopupMenuThemeData,DropdownMenuThemeData,DatePickerThemeData, andTimePickerThemeData. - New Material extension methods: added
.dIconButton(context),.dSegmentedButton(context),.dBadge(context),.dDrawer(context),.dBottomAppBar(context),.dNavRail(context),.dPopupMenu(context),.dDropdownMenu(context),.dDatePicker(context), and.dTimePicker(context). - Picker semantic color channels: added explicit Date/Time picker utilities such as
date-header-bg-*,date-day-bg-*,date-range-selection-overlay-*,time-dial-bg-*,time-dial-hand-*, andtime-hour-minute-bg-*. - State fidelity: Material adapters continue to use only colors and states explicitly declared by the class string; no hover/focus/pressed alpha or disabled colors are derived by DACS.
- Component color channels: added semantic component color support inside
DacsStyle/DacsResolvedStylefor advanced adapters without adding one field per picker property. - Widget support docs: expanded
doc/widget-support.mdwith support tables for the new Material 3 adapters and picker-specific channels. - Tests: added focused coverage for Phase 6A, Phase 6B, and Phase 7 adapters.
0.4.0 #
- Parser/resolver separation: class strings now parse into
DacsStyleSheet, with base styles separated from conditional rules before context/state resolution. - Compiler configuration: added
Dacs.configure(...)andDacsCompiler.compile(...)with context-free compilation, configurable cache size, unknown utility diagnostics, and optional strict mode. - Last class wins: conditional rules now preserve source order so later classes win consistently, including overlapping
dark:, breakpoint, and compound variants. - Compound variants: chained variants such as
dark:md:hover:bg-red-500,focus:error:border-red-500, andlight:disabled:text-gray-400resolve through structured conditions. - Adapter split: Material conversion logic moved into focused internal adapters for buttons, inputs, checkbox/radio, switch, chip, menu, navigation bar, data table, scrollbar, search bar, slider, layout, text, box, border, gradient, constraints, and transforms.
- Public API cleanup: concrete adapters and internal resolver types are no longer exported from
package:dacs/dacs.dart; public exports focus onDacsStyle,DacsStyleSheet,DacsLayoutStyle, extensions, and tokens. - Public docs lint: enabled
public_member_api_docsand documented the exported API surface. - ButtonStyle expansion:
surfaceTintColor,iconColor,iconSize,minimumSize,fixedSize,maximumSize,mouseCursor, and dynamicshapenow support WidgetState-aware resolution. - InputDecoration phase:
.dInput(context)/.dInputOf(context)now map base, focused, disabled, error, and focused-error borders to nativeInputDecorationborder slots. - Input text helpers: added
label-[...],hint-[...],helper-[...],error-[...],prefix-[...], andsuffix-[...]tokens forInputDecoration. - Input flags: added
filled,not-filled,dense, andnot-dense. - Tokenizer improvement: arbitrary bracket values may contain spaces, enabling tokens like
helper-[Use your work email]. - Layout/style helpers: added
.dFixedSize,.dLayout,.dBorder,.dBorderSide,.dRadius,.dConstraints,.dAlignment,.dShapeBorder, plus context-aware*Of(context)variants. - Layout utilities: expanded reusable parsing for
min-w-*,max-w-*,min-h-*,max-h-*,aspect-*,overflow-*,object-cover, andobject-contain. - Material coverage: added/expanded adapters and tests for
RadioThemeData,MenuStyle,SearchBarThemeData,NavigationBarThemeData,DataTableThemeData,ScrollbarThemeData, andSliderThemeData. - Documentation: added
doc/widget-support.mdwith per-widget property support tables and updated README examples for TextField styling versus decoration. - Project governance and CI: added GitHub Actions for format/analyze/tests/docs/pana, contributing guidelines, code of conduct, issue/PR templates, versioning policy, and category docs under
doc/.
0.3.0 #
- Theme colors: use
ColorSchemekeys directly:text-primary,bg-surface,border-error,from-tertiary, etc. - Arbitrary values:
text-[#ff0000],bg-[rgb(255,0,0)],p-[20],w-[50%],rounded-[12]. - Material widget extensions: 26 widgets:
.dButton(context),.dCheckbox(context),.dCard(context),.dAppBar(context), etc. - WidgetState variants:
hover:,focus:,active:,disabled:,selected:,error:,pressed:,dragged:,scrolledUnder:. - Chained compound variants: combine any prefixes:
dark:hover:,dark:md:focus:,light:lg:disabled:. - Split padding/margin:
.dPadsreturns padding,.dMarginreturns margin (breaking change from 0.2.0). ClassParsersingleton + LRU cache: single instance with auto-eviction at 500 entries.- Internal:
_addCompoundVariantcorrectly resolves theme colors over base. - Removed public
ClassParserexport andclearCache(); cache is self-managed.
0.2.0 #
- Variants: dark/light mode (
dark:,light:) and responsive breakpoints (sm:,md:,lg:,xl:,2xl:). - Context-aware extensions:
.dTextOf(context),.dBoxOf(context),.dPadsOf(context), etc. resolve variants fromMediaQuery. DacsStyle.resolve()/resolveFor(): merge variants into a single style based on brightness and screen width.DacsStyle.clone()/mergeFrom(): utility methods for style composition.- Position:
inset-*,top-*,right-*,bottom-*,left-*via.dPosition. - Transform:
scale-*,rotate-*,translate-*,skew-*via.dTransform. - Gradient:
bg-gradient-to-*,from-*,via-*,to-*via.dGradient. - Decoration style/thickness/color:
decoration-solid,decoration-2,decoration-red-500, etc. ClassParsercache: static cache avoids redundant parsing.- Renamed extension getters:
.dacsTextto.dText,.dacsPadto.dPads,.dacsBoxto.dBox,.dacsStyleto.dStyle,.dacsMarginto.dPads.
0.1.0 #
- Initial release.
- Tailwind-inspired utility classes: text, font, text/bg/border color classes.
- Spacing:
p-*,m-*with directional variants (px,py,pt,pr,pb,pl). - Border radius:
rounded-*with directional variants (t,b,l,r,tl,tr,bl,br). - Sizing:
w-*,h-*,opacity-*. - Shadows:
shadow-smtoshadow-2xl,shadow-inner,shadow-none. - Typography:
italic,underline,line-through,tracking-*,leading-*,decoration-*. - String extensions:
.dText,.dPads,.dBox,.dStyle,.dShadow,.dSize. - Full Tailwind v3 color palette (22 colors x 11 shades).