Add input_class and control_class props to form components#2
Merged
Add input_class and control_class props to form components#2
Conversation
FormField, Select, Textarea now accept input_class (appended to the main input element's class string). CheckboxGroup accepts control_class (appended to the wrapping <div class="control">). Both Jinja2 and Cotton template sets updated. Existing tests updated to pass empty defaults; new tests verify prop applied to correct element and default renders without extra class. Closes #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1
Summary
CfFormField,CfSelect,CfTextareanow acceptinput_class— appended to the main input element's class string alongside Bulma's own classesCfCheckboxGroupacceptscontrol_class— appended to the<div class="control">wrapper""— no visual change when omittedUsage
{# Rounded search input #} <c-cf.form-field name="q" label="Search" value="" error="" type="text" input_class="is-rounded" /> {# Fixed-height textarea #} <c-cf.textarea name="bio" label="Bio" value="" error="" input_class="has-fixed-size" /> {# Flex-wrapped checkbox group #} <c-cf.checkbox-group name="tags" label="Tags" choices="..." selected="[]" error="" control_class="is-flex is-flex-wrap-wrap gap-2" />JinjaX equivalent uses the same prop names:
Test Plan
input_class=""/control_class=""defaults (required byStrictUndefinedin the Jinja2 test environment)ruff checkandruff format --check: clean🤖 Generated with Claude Code