-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor button styles implementation to more maintainable approach w…
…ith simpler naming
- Loading branch information
Showing
21 changed files
with
396 additions
and
268 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
"@salt-ds/core": patch | ||
--- | ||
|
||
Refactor internal implementation of button styles | ||
|
||
- this is a non-breaking refactor of how we organise the styles within the CSS file. | ||
- removes un-supported/un-documented vars prefixed `--saltButton` | ||
|
||
``` | ||
--saltButton-alignItems | ||
--saltButton-background | ||
--saltButton-background-active | ||
--saltButton-background-active-hover | ||
--saltButton-background-disabled | ||
--saltButton-background-hover | ||
--saltButton-borderColor | ||
--saltButton-borderColor-active | ||
--saltButton-borderColor-disabled | ||
--saltButton-borderColor-hover | ||
--saltButton-borderRadius | ||
--saltButton-borderStyle | ||
--saltButton-borderWidth | ||
--saltButton-cursor | ||
--saltButton-cursor-disabled | ||
--saltButton-fontFamily | ||
--saltButton-fontSize | ||
--saltButton-fontWeight | ||
--saltButton-height | ||
--saltButton-justifyContent | ||
--saltButton-letterSpacing | ||
--saltButton-lineHeight | ||
--saltButton-margin | ||
--saltButton-minWidth | ||
--saltButton-padding | ||
--saltButton-text-color | ||
--saltButton-text-color-active | ||
--saltButton-text-color-active-hover | ||
--saltButton-text-color-disabled | ||
--saltButton-text-color-hover | ||
--saltButton-textAlign | ||
--saltButton-textTransform | ||
--saltButton-width | ||
``` | ||
|
||
if using these vars then use the equivalent `button` prefix vars, that map to CSS attributes. | ||
|
||
```diff | ||
- --saltButton-background | ||
+ --button-background | ||
``` | ||
|
||
- switched approach to a minimal set of base styles that consistently apply CSS variables, making the style easier to read and maintain | ||
- updated core/stable references to `--saltButton` to `--button` in `Button`, `Input`, `MultilineInput`, `NavigationItem`, `Pagination`, `Pill` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
.saltPageButton { | ||
--saltButton-minWidth: var(--salt-size-base); | ||
--saltButton-fontWeight: var(--salt-text-fontWeight); | ||
--saltButton-height: var(--salt-size-base); | ||
--saltButton-text-color: var(--salt-content-primary-foreground); | ||
--saltButton-background-active: var(--salt-selectable-background-selected); | ||
--saltButton-text-color-active: var(--salt-content-primary-foreground); | ||
--button-minWidth: var(--salt-size-base); | ||
--button-fontWeight: var(--salt-text-fontWeight); | ||
--button-height: var(--salt-size-base); | ||
--button-color: var(--salt-content-primary-foreground); | ||
} | ||
.saltPageButton:active { | ||
--button-background-active: var(--salt-selectable-background-selected); | ||
--button-color-active: var(--salt-content-primary-foreground); | ||
} | ||
|
||
.saltPageButton:hover, | ||
.saltPageButton:focus-visible { | ||
--saltButton-text-color-hover: var(--salt-content-primary-foreground); | ||
--saltButton-background-hover: var(--salt-selectable-background-hover); | ||
--button-color-hover: var(--salt-content-primary-foreground); | ||
--button-background-hover: var(--salt-selectable-background-hover); | ||
} | ||
|
||
.saltPageButton:disabled { | ||
--saltButton-text-color-disabled: var(--salt-content-secondary-foreground); | ||
--saltButton-cursor-disabled: var(--salt-editable-cursor-readonly); | ||
--button-color-disabled: var(--salt-content-secondary-foreground); | ||
--button-cursor-disabled: var(--salt-editable-cursor-readonly); | ||
} | ||
|
||
.saltPageButton-selected { | ||
--saltButton-background: var(--salt-selectable-background-selected); | ||
--button-background: var(--salt-selectable-background-selected); | ||
} | ||
.saltPageButton-selected:focus-visible { | ||
--saltButton-background-hover: var(--salt-selectable-background-selected); | ||
--button-background-hover: var(--salt-selectable-background-selected); | ||
} | ||
|
||
.saltPageButton-fixed { | ||
--saltButton-padding: 0; | ||
--button-padding: 0; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#toolbar-simple-collapsible [data-collapsed] { | ||
--saltButton-fontSize: 0; | ||
--saltButton-letterSpacing: 0; | ||
--button-fontSize: 0; | ||
--button-letterSpacing: 0; | ||
} |