feat: optional baseline stylesheet at @formhaus/core/style.css#34
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2d788e3 to
0ba59be
Compare
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.
Adds an opt-in stylesheet that gives the default React and Vue field components a sensible look without forcing a UI kit. Imported via:
Why
Today
pnpm install @formhaus/react+ copy-paste from the README produces a vertical stack of bare<input>elements with no spacing, no focus state, no error colour. First impression: "is this alpha?" Devs who plug in a UI kit don't see this, but the README/Quick Start path does.Two design constraints:
--fh-color-primary,--fh-radius,--fh-gap, etc.). Override at:rootor per-form to retheme without forking.What's in the CSS (~180 lines)
fh-form,fh-form__fields,fh-field: vertical stack with consistent gapsfh-field__input(and all variants): padding, border, focus ring, disabled,aria-invalidred borderfh-field__label,fh-field__required(asterisk),fh-field__error,fh-field__helperfh-form-actions+__buttonvariants (primary / secondary / text)fh-step-progress+ bar / fill / counter / title / descriptionUses
:where(.fh-form)to declare custom properties at zero specificity, so apps can override at:rootwithout!important.Packaging
packages/core/style.cssexports:"./style.css": "./style.css"files: includesstyle.csssideEffects:["**/*.css"](wasfalse) so bundlers preserve the import on tree-shakecheck:types: added--exclude-entrypoints ./style.cssso attw doesn't try to resolve CSS as JS typesDocs
Mention added in
docs/guide/index.md,packages/core/README.md,packages/react/README.md,packages/vue/README.md.Verifying
pnpm install --frozen-lockfile && pnpm -r run build && pnpm -r run test && pnpm lint:packages && pnpm check:types && pnpm docs:buildall clean. Tarball containspackage/style.css.