-
Notifications
You must be signed in to change notification settings - Fork 799
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
RNA buttons: add styles and storybook documentation #21496
Closed
Closed
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a1a3aef
Add base-styles changelog
keoshi f65095f
Add storybook changelog
keoshi 55771be
RNA buttons: add styles and storybook documentation
keoshi 95e90b1
Add newline at the end of files
keoshi 8dac1be
Merge branch 'master' into update/rna-buttons-styles
sergeymitr 01b0e49
Reuse the base styles for `ActionButton` component.
sergeymitr cea6ff0
Connection Screen button styling - tiny fix.
sergeymitr 8493851
Merge branch 'master' into update/rna-buttons-styles
sergeymitr b0ea51c
Connection Screen button styling - another tiny fix.
sergeymitr 9d2ad4b
Add RGB colors
keoshi 3e1095d
Add disabled styles
keoshi b2e7017
Add stories for disabled buttons
keoshi 31dbd5a
Merge branch 'master' into update/rna-buttons-styles
sergeymitr df015ff
Bump package versions.
sergeymitr 7fedc6f
RNA components: Cleanup individual button styles
fgiannar 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
@import './variables'; | ||
@import './colors'; | ||
|
||
.components-button { | ||
border-radius: var( --jp-border-radius ); | ||
|
||
&:focus:not(:disabled) { | ||
box-shadow: inset 0 0 0 1px var( --jp-color-white ), 0 0 0 var(--wp-admin-border-width-focus) var( --jp-color-black ); | ||
} | ||
|
||
&:active:not(:disabled) { | ||
color: var( --jp-color-black ); | ||
} | ||
} | ||
|
||
.components-button.is-primary:not(.is-destructive) { | ||
background: var( --jp-color-black ); | ||
sergeymitr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
&:hover:not(:disabled) { | ||
background: var( --jp-color-gray-80 ); | ||
} | ||
|
||
&:focus:not(:disabled) { | ||
box-shadow: inset 0 0 0 1px var( --jp-color-white ), 0 0 0 var(--wp-admin-border-width-focus) var( --jp-color-black ); | ||
} | ||
|
||
&:disabled { | ||
color: rgba( var( --jp-color-white-rgb ), 0.4 ); | ||
background: var( --jp-color-black ); | ||
} | ||
} | ||
|
||
.components-button.is-secondary:not(.is-destructive) { | ||
color: var( --jp-color-black ); | ||
box-shadow: inset 0 0 0 1px var( --jp-color-black ); | ||
|
||
&:hover:not(:disabled) { | ||
color: var( --jp-color-black ); | ||
background: var( --jp-color-gray-0 ); | ||
box-shadow: inset 0 0 0 1px var( --jp-color-black ); | ||
} | ||
|
||
&:focus:not(:disabled) { | ||
box-shadow: inset 0 0 0 1px var( --jp-color-white ), 0 0 0 var(--wp-admin-border-width-focus) var( --jp-color-black ); | ||
} | ||
|
||
&:disabled { | ||
color: rgba( var( --jp-color-black-rgb ), 0.4 ); | ||
} | ||
} | ||
|
||
.components-button.is-link { | ||
color: var( --jp-color-black ); | ||
|
||
&:hover { | ||
text-decoration-thickness: 3px; | ||
} | ||
} | ||
|
||
.components-button.is-destructive { | ||
|
||
|
||
&:hover:not(:disabled) { | ||
background: var( --jp-color-gray-80 ); | ||
} | ||
|
||
&:focus:not(:disabled) { | ||
color: var( --jp-color-white ); | ||
box-shadow: inset 0 0 0 1px var( --jp-color-white ), 0 0 0 var(--wp-admin-border-width-focus) var( --jp-color-red-60 ); | ||
} | ||
|
||
&:disabled { | ||
color: rgba( var( --jp-color-white-rgb ), 0.4 ); | ||
} | ||
|
||
&.is-secondary { | ||
|
||
&:focus:not(:disabled) { | ||
color: var( --jp-color-red-50 ); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
&.is-link { | ||
|
||
&:hover:not(:disabled) { | ||
box-shadow: none; | ||
} | ||
|
||
&:focus:not(:disabled) { | ||
color: var( --jp-color-red-50 ); | ||
} | ||
} | ||
} |
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,15 @@ | ||
:root { | ||
--jp-color-black: #000000; | ||
--jp-color-white: #FFFFFF; | ||
|
||
--jp-color-black-rgb: 0, 0, 0; | ||
--jp-color-white-rgb: 255, 255, 255; | ||
|
||
--jp-color-gray-0: #F6F7F7; | ||
--jp-color-gray-80: #2C3338; | ||
|
||
--jp-color-red-0: #F7EBEC; | ||
--jp-color-red-50: #D63638; | ||
--jp-color-red-60: #B32D2E; | ||
--jp-color-red-80: #8A2424; | ||
} |
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,3 @@ | ||
:root { | ||
--jp-border-radius: 4px; | ||
} |
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,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Added base styles for RNA buttons. | ||
|
||
|
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.
We discussed it with the team today, and discovered that these styles will also apply to non-RNA buttons, and in some cases could affect even non-Jetpack elements on the page.
We're discussing possible solutions in Slack: p1635967176436400-slack-CBG1CP4EN