123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921(** Form element utilities - matching Tailwind v4's [\@tailwindcss/forms]
plugin.
These utilities use the ring/shadow variable system from Effects for focus
states, ensuring proper type-safety and variable composition.
Form utilities are split into two priority groups to match Tailwind's
output:
- checkbox, radio, input: priority 3 (before layout at 4)
- select, textarea: priority 7 (after sizing at 6) *)moduleCss=Cascade.Cssletforced_colors_active=Css.Media.Cond(Css.Media.Feature(Css.Media.Plain(Css.Media.Forced_colors,Css.Media.IdentCss.Media.Active)))(* Shared colors and focus ring helpers *)letblue_600=Css.oklch54.60.245262.881letgray_500=Css.oklch55.10.027264.364letring_offset_shadow()=letopenCssinletspread:length=Var(var_ref"tw-ring-offset-width")inletcolor:color=Var(var_ref"tw-ring-offset-color")inshadow~inset:false~inset_var:"tw-ring-inset"~inset_var_no_fallback:true~h_offset:Zero~v_offset:Zero~blur:Zero~spread~color()letring_shadow~ring_width_px=letopenCssinletoffset_width_default:length=Px0.inletspread:length=CalcCalc.(add(px(float_of_intring_width_px))(var~default:offset_width_default"tw-ring-offset-width"))inletcolor:color=Var(var_ref"tw-ring-color")inshadow~inset:false~inset_var:"tw-ring-inset"~inset_var_no_fallback:true~h_offset:Zero~v_offset:Zero~blur:Zero~spread~color()letfocus_ring_decls~offset_width~ring_width_px=letopenCssinletd_ring_inset,_=Var.bindingEffects.ring_inset_var(Css.Variables.custom_value_var_empty_fallback"tw-empty")inletd_offset_width,_=Var.bindingEffects.ring_offset_width_varoffset_widthinletd_offset_color,_=Var.bindingEffects.ring_offset_color_var(hex"#fff")inletd_ring_color,_=Var.bindingEffects.ring_color_varblue_600inletd_ring_offset_shadow,_=Var.bindingEffects.ring_offset_shadow_var(ring_offset_shadow())inletd_ring_shadow,_=Var.bindingEffects.ring_shadow_var(ring_shadow~ring_width_px)inletbox_shadow_vars:Css.shadowlist=[Var(Var.referenceEffects.ring_offset_shadow_var);Var(Var.referenceEffects.ring_shadow_var);Var(Var.referenceEffects.shadow_var);]in[outline_offset(Px2.);d_ring_inset;d_offset_width;d_offset_color;d_ring_color;d_ring_offset_shadow;d_ring_shadow;box_shadowsbox_shadow_vars;]letinput_focus_decls=letopenCssinfocus_ring_decls~offset_width:(Px0.)~ring_width_px:1@[border_colorblue_600;outline(Shorthand{width=Some(Px2.);style=SomeSolid;color=Some(hex"#0000");});]letcheckbox_focus_decls=letopenCssinfocus_ring_decls~offset_width:(Px2.)~ring_width_px:2@[outline(Shorthand{width=Some(Px2.);style=SomeSolid;color=Some(hex"#0000");});](* Handler for checkbox/radio/input - priority 3 *)moduleHandler=structopenStyletypet=Form_input|Form_checkbox|Form_radiotypeUtility.base+=Selfoftletname="forms"letpriority_=3letform_input=letopenCssinletopenCss.Selectorinletbase_sel=class_"form-input"inletd_shadow,_=Var.bindingEffects.shadow_var(shadow~h_offset:Zero~v_offset:Zero~color:(hex"#0000")())inletrules=[rule~selector:base_sel[appearanceNone;d_shadow;background_color(hex"#fff");border_width(Px1.);border_colorgray_500;border_radius(Radius{horizontal=[LengthZero];vertical=None});padding[Rem0.5;Rem0.75];font_size(Rem1.);line_height(Rem1.5);];rule~selector:(compound[base_sel;Focus])input_focus_decls;rule~selector:(compound[base_sel;Placeholder])[colorgray_500;opacity(Opacity_number1.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_fields_wrapper])[padding[Px0.]];rule~selector:(compound[base_sel;Webkit_date_and_time_value])[min_height(Em1.5)];rule~selector:(compound[base_sel;Webkit_date_and_time_value])[text_alignInherit];rule~selector:(compound[base_sel;Webkit_datetime_edit])[displayInline_flex];rule~selector:(compound[base_sel;Webkit_datetime_edit])[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_year_field])[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_month_field])[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_day_field])[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_hour_field])[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_minute_field])[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_second_field])[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_millisecond_field])[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:(compound[base_sel;Webkit_datetime_edit_meridiem_field])[padding_top(Px0.);padding_bottom(Px0.)];]instyle~rules:(Somerules)[]letform_checkbox=letopenCssinletopenCss.Selectorinletbase_sel=class_"form-checkbox"inletd_shadow,_=Var.bindingEffects.shadow_var(shadow~h_offset:Zero~v_offset:Zero~color:(hex"#0000")())inletrules=[rule~selector:base_sel[appearanceNone;webkit_print_color_adjustExact;print_color_adjustExact;vertical_alignMiddle;webkit_user_selectNone;user_selectNone;colorblue_600;d_shadow;background_color(hex"#fff");background_originBorder_box;border_width(Px1.);border_colorgray_500;border_radius(radiusZero);flex_shrink0.0;width(Rem1.);height(Rem1.);padding[Px0.];displayInline_block;];rule~selector:(compound[base_sel;Focus])checkbox_focus_decls;rule~selector:(compound[base_sel;Checked])[background_colorCurrent;background_image(Url"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' \
xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 \
4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 \
011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 \
0z'/%3e%3c/svg%3e");background_position[Single(Pct50.)];background_repeatNo_repeat;background_size(Size(Pct100.,Pct100.));border_color(hex"#0000");];media~condition:forced_colors_active[rule~selector:(compound[base_sel;Checked])[appearanceAuto];];rule~selector:(Selector.list[compound[base_sel;Checked;Hover];compound[base_sel;Checked;Focus];])[background_colorCurrent;border_color(hex"#0000")];rule~selector:(compound[base_sel;Indeterminate])[background_colorCurrent;background_image(Url"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' \
fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' \
stroke-linecap='round' stroke-linejoin='round' \
stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background_position[Single(Pct50.)];background_repeatNo_repeat;background_size(Size(Pct100.,Pct100.));border_color(hex"#0000");];media~condition:forced_colors_active[rule~selector:(compound[base_sel;Indeterminate])[appearanceAuto];];rule~selector:(Selector.list[compound[base_sel;Indeterminate;Hover];compound[base_sel;Indeterminate;Focus];])[background_colorCurrent;border_color(hex"#0000")];]instyle~rules:(Somerules)[]letform_radio=letopenCssinletopenCss.Selectorinletbase_sel=class_"form-radio"inletd_shadow,_=Var.bindingEffects.shadow_var(shadow~h_offset:Zero~v_offset:Zero~color:(hex"#0000")())inletrules=[rule~selector:base_sel[appearanceNone;webkit_print_color_adjustExact;print_color_adjustExact;vertical_alignMiddle;webkit_user_selectNone;user_selectNone;colorblue_600;d_shadow;background_color(hex"#fff");background_originBorder_box;border_width(Px1.);border_colorgray_500;border_radius(radius(Pct100.0));flex_shrink0.0;width(Rem1.);height(Rem1.);padding[Px0.];displayInline_block;];rule~selector:(compound[base_sel;Focus])checkbox_focus_decls;rule~selector:(compound[base_sel;Checked])[background_colorCurrent;background_image(Url"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' \
xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' \
r='3'/%3e%3c/svg%3e");background_position[Single(Pct50.)];background_repeatNo_repeat;background_size(Size(Pct100.,Pct100.));border_color(hex"#0000");];media~condition:forced_colors_active[rule~selector:(compound[base_sel;Checked])[appearanceAuto];];rule~selector:(Selector.list[compound[base_sel;Checked;Hover];compound[base_sel;Checked;Focus];])[background_colorCurrent;border_color(hex"#0000")];]instyle~rules:(Somerules)[]letto_style_theme=function|Form_input->form_input|Form_checkbox->form_checkbox|Form_radio->form_radioletsuborder=function|Form_checkbox->0|Form_radio->1|Form_input->2letof_class_theme=function|"form-input"->OkForm_input|"form-checkbox"->OkForm_checkbox|"form-radio"->OkForm_radio|_->Error(`Msg"Not a form utility")letto_class=function|Form_input->"form-input"|Form_checkbox->"form-checkbox"|Form_radio->"form-radio"end(* Handler for select/textarea - priority 7 *)moduleSelect=structopenStyletypet=Form_select|Form_textareatypeUtility.base+=Selfoftletname="forms_select"letpriority_=8(* After sizing (6), flex_props (7) *)letform_textarea=letopenCssinletopenCss.Selectorinletbase_sel=class_"form-textarea"inletd_shadow,_=Var.bindingEffects.shadow_var(shadow~h_offset:Zero~v_offset:Zero~color:(hex"#0000")())inletrules=[rule~selector:base_sel[appearanceNone;d_shadow;background_color(hex"#fff");border_width(Px1.);border_colorgray_500;border_radius(radiusZero);padding[Rem0.5;Rem0.75];font_size(Rem1.);line_height(Rem1.5);];rule~selector:(compound[base_sel;Focus])input_focus_decls;rule~selector:(compound[base_sel;Placeholder])[colorgray_500;opacity(Opacity_number1.)];]instyle~rules:(Somerules)[]letform_select=letopenCssinletopenCss.Selectorinletbase_sel=class_"form-select"inletd_shadow,_=Var.bindingEffects.shadow_var(shadow~h_offset:Zero~v_offset:Zero~color:(hex"#0000")())in(* Emit a single .form-select base rule, then :focus, then :where(...) -
matching Tailwind's de-nested layout. Tailwind's source uses CSS nesting
(.form-select { base; &:focus {..}; more-base; &:where {..} }) which its
optimizer flattens into one consolidated outer rule plus the de-nested
children. Splitting our base props across two .form-select rules
separated by :focus would be structurally different (and break the
suborder parity test) even though our [:focus] decls don't override any
base prop here. *)letrules=[rule~selector:base_sel[appearanceNone;d_shadow;background_color(hex"#fff");border_width(Px1.);border_colorgray_500;border_radius(radiusZero);padding[Rem0.5;Rem0.75];font_size(Rem1.);line_height(Rem1.5);webkit_print_color_adjustExact;print_color_adjustExact;background_image(Url"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' \
fill='none' viewBox='0 0 20 20'%3e%3cpath \
stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' \
stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 \
4-4'/%3e%3c/svg%3e");background_position[Edge_offset_axis("right",Length(Rem0.5),"center")];background_repeatNo_repeat;background_size(Size(Em1.5,Em1.5));padding_right(Rem2.5);];rule~selector:(compound[base_sel;Focus])input_focus_decls;rule~selector:(compound[base_sel;Where[Compound[Attribute(None,Regular"size",Presence,None);Not[Attribute(None,Regular"size",Exact"1",None)];];];])[background_imageInitial;background_position[Initial];background_repeatUnset;background_sizeInitial;print_color_adjustUnset;padding_right(Rem0.75);];]instyle~rules:(Somerules)[]letto_style_theme=function|Form_select->form_select|Form_textarea->form_textarealetsuborder=functionForm_select->0|Form_textarea->1letof_class_theme=function|"form-select"->OkForm_select|"form-textarea"->OkForm_textarea|_->Error(`Msg"Not a form select utility")letto_class=function|Form_select->"form-select"|Form_textarea->"form-textarea"end(* Register both handlers *)let()=Utility.register(moduleHandler)let()=Utility.register(moduleSelect)(* Public API *)letform_input=Utility.base(Handler.SelfHandler.Form_input)letform_checkbox=Utility.base(Handler.SelfHandler.Form_checkbox)letform_radio=Utility.base(Handler.SelfHandler.Form_radio)letform_select=Utility.base(Select.SelfSelect.Form_select)letform_textarea=Utility.base(Select.SelfSelect.Form_textarea)(* ======================================================================== Base
layer stylesheet - rules that apply to native HTML form elements when the
@tailwindcss/forms plugin is used
======================================================================== *)(** Type selectors for form elements - wrapped with input:where() to match
Tailwind v4 *)lettype_text=Css.Selector.(element"input"&&where[attribute"type"(Exact"text")])lettype_email=Css.Selector.(element"input"&&where[attribute"type"(Exact"email")])lettype_url=Css.Selector.(element"input"&&where[attribute"type"(Exact"url")])lettype_password=Css.Selector.(element"input"&&where[attribute"type"(Exact"password")])lettype_number=Css.Selector.(element"input"&&where[attribute"type"(Exact"number")])lettype_date=Css.Selector.(element"input"&&where[attribute"type"(Exact"date")])lettype_datetime_local=Css.Selector.(element"input"&&where[attribute"type"(Exact"datetime-local")])lettype_month=Css.Selector.(element"input"&&where[attribute"type"(Exact"month")])lettype_search=Css.Selector.(element"input"&&where[attribute"type"(Exact"search")])lettype_tel=Css.Selector.(element"input"&&where[attribute"type"(Exact"tel")])lettype_time=Css.Selector.(element"input"&&where[attribute"type"(Exact"time")])lettype_week=Css.Selector.(element"input"&&where[attribute"type"(Exact"week")])lettype_checkbox=Css.Selector.(element"input"&&where[attribute"type"(Exact"checkbox")])lettype_radio=Css.Selector.(element"input"&&where[attribute"type"(Exact"radio")])lettype_file=Css.Selector.(element"input"&&where[attribute"type"(Exact"file")])letinput_no_type=Css.Selector.(element"input"&&where[not[attribute"type"Presence]])letmultiple=Css.Selector.(element"select"&&where[attribute"multiple"Presence])letsize=Css.Selector.(attribute"size"Presence)letsize_1=Css.Selector.attribute"size"(Exact"1")(** Combined text input selector - matches all text-like inputs *)lettext_inputs=Css.Selector.list[type_text;input_no_type;type_email;type_url;type_password;type_number;type_date;type_datetime_local;type_month;type_search;type_tel;type_time;type_week;multiple;Css.Selector.element"textarea";Css.Selector.element"select";](** Focus ring declarations for text inputs (1px ring, no offset) *)lettext_input_focus_ring_decls=letopenCssinfocus_ring_decls~offset_width:(Px0.)~ring_width_px:1@[border_colorblue_600;outline(Shorthand{width=Some(Px2.);style=SomeSolid;color=Some(hex"#0000");});](** Focus ring declarations for checkboxes/radios (2px ring, 2px offset) *)letcheckbox_focus_ring_decls=letopenCssinfocus_ring_decls~offset_width:(Px2.)~ring_width_px:2@[outline(Shorthand{width=Some(Px2.);style=SomeSolid;color=Some(hex"#0000");});](** Webkit datetime edit pseudo-element rules for text inputs *)letwebkit_datetime_rules()=letopenCssin[rule~selector:Selector.Webkit_datetime_edit_fields_wrapper[padding[Px0.]];rule~selector:Selector.Webkit_date_and_time_value[min_height(Em1.5)];rule~selector:Selector.Webkit_date_and_time_value[text_alignInherit];rule~selector:Selector.Webkit_datetime_edit[displayInline_flex];rule~selector:Selector.Webkit_datetime_edit[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:Selector.Webkit_datetime_edit_year_field[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:Selector.Webkit_datetime_edit_month_field[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:Selector.Webkit_datetime_edit_day_field[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:Selector.Webkit_datetime_edit_hour_field[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:Selector.Webkit_datetime_edit_minute_field[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:Selector.Webkit_datetime_edit_second_field[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:Selector.Webkit_datetime_edit_millisecond_field[padding_top(Px0.);padding_bottom(Px0.)];rule~selector:Selector.Webkit_datetime_edit_meridiem_field[padding_top(Px0.);padding_bottom(Px0.)];]lettext_input_items=letopenCssin[type_text;input_no_type;type_email;type_url;type_password;type_number;type_date;type_datetime_local;type_month;type_search;type_tel;type_time;type_week;multiple;Selector.element"textarea";Selector.element"select";](** Text inputs base styles *)lettext_inputs_base()=letopenCssinletd_shadow,_=Var.bindingEffects.shadow_var(shadow~h_offset:Zero~v_offset:Zero~color:(hex"#0000")())in[rule~selector:text_inputs[appearanceNone;d_shadow;background_color(hex"#fff");border_width(Px1.);border_colorgray_500;border_radius(radiusZero);padding[Rem0.5;Rem0.75];font_size(Rem1.);line_height(Rem1.5);];rule~selector:Selector.(is_text_input_items&&Focus)text_input_focus_ring_decls;rule~selector:Selector.(list[element"input"&&Placeholder;element"textarea"&&Placeholder;])[colorgray_500;opacity(Opacity_number1.)];]@webkit_datetime_rules()(** Select dropdown base styles *)letselect_base()=letopenCssin[rule~selector:(Selector.element"select")[print_color_adjustExact;background_image(Url"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' \
fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 \
0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' \
stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background_position[Edge_offset_axis("right",Length(Rem0.5),"center")];background_repeatNo_repeat;background_size(Size(Em1.5,Em1.5));padding_right(Rem2.5);];rule~selector:Selector.(list[multiple;Selector.element"select"&&where[size&¬[size_1]];])[background_imageInitial;background_position[Initial];background_repeatUnset;background_sizeInitial;print_color_adjustUnset;padding_right(Rem0.75);];]letforced_colors_checked_appearanceselector=letopenCssinmedia~condition:forced_colors_active[rule~selector[appearanceAuto]](** Checked state rules for checkbox/radio *)letcheckbox_checked_rules()=letopenCssin[rule~selector:Selector.(list[type_checkbox&&Checked;type_radio&&Checked])[background_colorCurrent;background_position[Single(Pct50.)];background_repeatNo_repeat;background_size(Size(Pct100.,Pct100.));border_color(hex"#0000");];rule~selector:Selector.(type_checkbox&&Checked)[background_image(Url"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' \
xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 \
1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 \
9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");];forced_colors_checked_appearanceSelector.(type_checkbox&&Checked);rule~selector:Selector.(type_radio&&Checked)[background_image(Url"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' \
xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' \
r='3'/%3e%3c/svg%3e");];forced_colors_checked_appearanceSelector.(type_radio&&Checked);rule~selector:Selector.(list[type_checkbox&&Checked&&Hover;type_checkbox&&Checked&&Focus;type_radio&&Checked&&Hover;type_radio&&Checked&&Focus;])[background_colorCurrent;border_color(hex"#0000")];](** Indeterminate state rules for checkbox *)letcheckbox_indeterminate_rules()=letopenCssin[(* 11. checkbox:indeterminate - all properties *)rule~selector:Selector.(type_checkbox&&Indeterminate)[background_colorCurrent;background_image(Url"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' \
fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' \
stroke-linecap='round' stroke-linejoin='round' stroke-width='2' \
d='M4 8h8'/%3e%3c/svg%3e");background_position[Single(Pct50.)];background_repeatNo_repeat;background_size(Size(Pct100.,Pct100.));border_color(hex"#0000");];(* 12. @media (forced-colors:active) checkbox:indeterminate *)media~condition:forced_colors_active[rule~selector:Selector.(type_checkbox&&Indeterminate)[appearanceAuto];];(* 13. Indeterminate hover/focus *)rule~selector:Selector.(list[type_checkbox&&Indeterminate&&Hover;type_checkbox&&Indeterminate&&Focus;])[background_colorCurrent;border_color(hex"#0000")];](** Checkbox and radio base styles - order matches Tailwind exactly with
interleaved forced-colors media queries *)letcheckbox_radio_base()=letopenCssinletd_shadow,_=Var.bindingEffects.shadow_var(shadow~h_offset:Zero~v_offset:Zero~color:(hex"#0000")())in[(* 1. Base styles for both *)rule~selector:Selector.(list[type_checkbox;type_radio])[appearanceNone;print_color_adjustExact;vertical_alignMiddle;webkit_user_selectNone;user_selectNone;colorblue_600;d_shadow;background_color(hex"#fff");background_originBorder_box;border_width(Px1.);border_colorgray_500;flex_shrink0.;width(Rem1.);height(Rem1.);padding[Px0.];displayInline_block;];(* 2. Checkbox border-radius: 0 *)rule~selector:type_checkbox[border_radius(radiusZero)];(* 3. Radio border-radius: 100% *)rule~selector:type_radio[border_radius(radius(Pct100.))];(* 4. Focus ring for both *)rule~selector:Selector.(list[type_checkbox&&Focus;type_radio&&Focus])checkbox_focus_ring_decls;]@checkbox_checked_rules()@checkbox_indeterminate_rules()(** File input base styles *)letfile_input_base()=letopenCssin[rule~selector:type_file[backgroundUnset;border_colorInherit;font_sizeUnset;line_heightInherit;border_widthZero;border_radius(radiusZero);padding[Px0.];];rule~selector:Selector.(type_file&&Focus)[(* Dual outline for webkit fallback - both must be preserved *)outline(Shorthand{width=Some(Px1.);style=SomeSolid;color=Some(SystemButton_text);});outline(Shorthand{width=Some(Px1.);style=SomeAuto;color=Some(SystemWebkit_focus_ring_color);});];](* Tailwind v4's [\@tailwindcss/forms] plugin defaults to the [base] strategy:
it resets native form controls globally ([input]/[select]/[textarea]/...),
not only elements bearing a [.form-*] class. Those global resets are the
forms base layer, emitted whenever the forms plugin is active. The rule order
below mirrors the plugin's own output. *)(** Complete base layer stylesheet for forms plugin *)letbase_stylesheet()=Css.v(text_inputs_base()@select_base()@checkbox_radio_base()@file_input_base())