-
Notifications
You must be signed in to change notification settings - Fork 81
feat(fab): add component tokens #11838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
add3d80
feat(fab): add component tokens
Elijbet fdf9096
fabTokens
Elijbet 154aeb5
refine selectors
Elijbet 9dea067
cleanup and add loading screenshot
Elijbet fb9640a
target internals of the button component
Elijbet d8f8ff4
cleanup shadowSelector
Elijbet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,40 @@ | ||
/** | ||
* CSS Custom Properties | ||
* | ||
* These properties can be overridden using the component's tag as selector. | ||
* | ||
* @prop --calcite-fab-background-color: Specifies the component's background color. | ||
* @prop --calcite-fab-border-color: Specifies the component's border color. | ||
* @prop --calcite-fab-corner-radius: Specifies the component's corner radius. | ||
* @prop --calcite-fab-text-color: Specifies the component's text color. | ||
* @prop --calcite-fab-loader-color: Specifies the component's loader color. | ||
* @prop --calcite-fab-shadow: Specifies the component's shadow. | ||
*/ | ||
|
||
:host { | ||
@apply flex bg-transparent; | ||
@apply flex; | ||
|
||
background-color: transparent; | ||
} | ||
|
||
@include disabled(); | ||
|
||
calcite-button { | ||
@apply shadow-2; | ||
--calcite-fab-shadow-internal: 0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08); | ||
box-shadow: var(--calcite-fab-shadow, var(--calcite-fab-shadow-internal)); | ||
|
||
&:hover { | ||
@apply shadow-2-lg; | ||
} | ||
&:active { | ||
@apply shadow-2-sm; | ||
} | ||
|
||
--calcite-button-background-color: var(--calcite-fab-background-color); | ||
--calcite-button-border-color: var(--calcite-fab-border-color); | ||
--calcite-button-corner-radius: var(--calcite-fab-corner-radius); | ||
--calcite-button-text-color: var(--calcite-fab-text-color); | ||
--calcite-button-loader-color: var(--calcite-fab-loader-color); | ||
} | ||
|
||
@include base-component(); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { html } from "../../support/formatting"; | ||
|
||
export const fabTokens = { | ||
calciteFabBackgroundColor: "", | ||
calciteFabBorderColor: "", | ||
calciteFabCornerRadius: "", | ||
calciteFabTextColor: "", | ||
calciteFabLoaderColor: "", | ||
calciteFabShadow: "", | ||
}; | ||
|
||
export const fab = html`<calcite-fab></calcite-fab>`; | ||
export const fabLoading = html`<calcite-fab loading></calcite-fab>`; |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: can the user customize the shadow when hovered/active using
--calcite-fab-shadow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shadow for
hover
andactive
is going away and designers advised not to add tokens for these in the time being.