feat(btn): full rewrite of button styles#4432
Open
pdanpdan wants to merge 4 commits intosaadeghi:masterfrom
Open
feat(btn): full rewrite of button styles#4432pdanpdan wants to merge 4 commits intosaadeghi:masterfrom
pdanpdan wants to merge 4 commits intosaadeghi:masterfrom
Conversation
Organize styles so that there is very little need for duplication. The only styles that do not work with tailwind responsive modifiers are the ones for disabled .btn-link and .btn-ghost. see saadeghi#4430
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.
Organize styles so that there is very little need for duplication.
The only styles that do not work with tailwind responsive modifiers are the ones for disabled .btn-link and .btn-ghost.
I have prepared 3 playgrounds that should cover most of the normal usage:
Problems fixed:
.filterthey do not show active statusaria-disabled="true"is not accounted for.btn-neutral .btn-softcannot be used--int-soft-bg: var(--color-neutral-content) 80%;).btn-soft,.btn-outline,.btn-dash,.btn-ghost,.btn-linkwhen there is contrast between fg (--btn-fg) and bg (--btn-color) button colors, but there is no contrast in rest state between bg (derivative of--color-base-100or page bg) and fg (--btn-color)--btn-rest-fgthat sets the fg color for buttons in rest state (only for soft, outline, dash, ghost) - it is ignored for.btn-neutralbecause that color has its own rules.btn-linkdoes not need any mitigation because it uses the same color all the time, so it can already be set by the user--btn-rest-fgis set for the whole theme, but it can be used for individual buttons also--btn-colorand ``--btn-fg` on buttons does not work as expectedclose #4430