-
Notifications
You must be signed in to change notification settings - Fork 100
feat(notice): update styles for SHINE #2109
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
Open
mukunku
wants to merge
16
commits into
beta
Choose a base branch
from
sal/SPARK-72
base: beta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d1f6f55
base styles for notice and toast
mukunku 778cd9e
dark mode
mukunku f836c24
light hc
mukunku 87a6862
cleanup
mukunku be59125
update svelte component
mukunku 6ab0a97
update links
mukunku 43cffb7
remove commented code
mukunku 4b2641b
lint
mukunku b2119a3
Create lazy-teachers-wink.md
mukunku de80843
update migration guide
mukunku 8e7b706
update baseline
mukunku db68836
fix lint, tests, and storybook
mukunku c2b44f2
lint harder
mukunku 56d1bef
fix tests
mukunku e8d8db5
Merge branch 'beta' into sal/SPARK-72
mukunku bbaf531
lint again
mukunku File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "@stackoverflow/stacks": minor | ||
| "@stackoverflow/stacks-svelte": minor | ||
| --- | ||
|
|
||
| feat(notice): update styles for SHINE | ||
|
|
||
| BREAKING CHANGES | ||
| * Markup for notices has been updated |
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 |
|---|---|---|
|
|
@@ -9,32 +9,18 @@ | |
| */ | ||
| .generate-variant-variables(@colorName: "", @modifier: "") { | ||
| & when (@modifier = "") { | ||
| --_no-bc: ~"var(--@{colorName}-300)"; | ||
| --_no-bg: ~"var(--@{colorName}-100)"; | ||
| --_no-btn-bg-active: ~"var(--@{colorName}-200)"; | ||
| --_no-btn-bg-focus: ~"var(--@{colorName}-200)"; | ||
| --_no-btn-fc: ~"var(--@{colorName}-500)"; | ||
| --_no-icon-bg: ~"var(--@{colorName}-200)"; | ||
| --_no-code-bc: ~"var(--@{colorName}-300)"; | ||
| --_no-code-bg: ~"var(--@{colorName}-200)"; | ||
|
|
||
| .highcontrast-mode({ | ||
| --_no-bc: ~"var(--@{colorName}-400)"; | ||
| }); | ||
| } | ||
|
|
||
| & when (@modifier = important) { | ||
| --_no-bc: var(--_no-bg); | ||
| --_no-bg: ~"var(--@{colorName}-400)"; | ||
| --_no-icon-bg: ~"var(--@{colorName}-500)"; | ||
| --_no-fc: var(--white); | ||
| --_no-btn-bg-active: ~"var(--@{colorName}-500)"; | ||
| --_no-btn-bg-focus: ~"var(--@{colorName}-500)"; | ||
| --_no-btn-fc: ~"var(--@{colorName}-100)"; | ||
| --_no-code-bc: ~"var(--@{colorName}-300)"; | ||
| --_no-code-bg: ~"var(--@{colorName}-500)"; | ||
|
|
||
| .highcontrast-mode({ | ||
| --_no-bg: ~"var(--@{colorName}-500)"; | ||
| }); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -47,47 +33,27 @@ | |
| * @baseClass - The base class name for the notice component | ||
| */ | ||
| .construct-notice-component(@baseClass) { | ||
| --_no-bc: var(--black-225); | ||
| --_no-bg: var(--black-100); | ||
| --_no-fc: var(--black-500); | ||
| --_no-btn-bg-active: var(--black-250); | ||
| --_no-btn-bg-focus: var(--black-225); | ||
| --_no-btn-fc: var(--_no-fc); | ||
| --_no-bg: var(--black-150); | ||
| --_no-icon-bg: var(--black-200); | ||
| --_no-fc: var(--black-600); | ||
| --_no-code-bc: var(--black-300); | ||
| --_no-code-bg: var(--black-200); | ||
| --_no-code-fc: var(--_no-fc); | ||
|
|
||
| // CONTEXTUAL STYLES | ||
| .highcontrast-mode({ | ||
| &, | ||
| &.@{baseClass}__danger, | ||
| &.@{baseClass}__info, | ||
| &.@{baseClass}__success, | ||
| &.@{baseClass}__warning { | ||
| --_no-code-bc: var(--black-400); | ||
| --_no-code-bg: var(--white); | ||
| --_no-code-fc: var(--black); | ||
|
|
||
| &.@{baseClass}__important { | ||
| --_no-code-bc: var(--black-200); | ||
| --_no-code-bg: var(--black); | ||
| --_no-code-fc: var(--white); | ||
| } | ||
| &:not(&__important) { | ||
| --_no-icon-bc: var(--_no-code-bc); | ||
| } | ||
|
|
||
| --_no-bc: var(--black-400); | ||
| }); | ||
|
|
||
| // MODIFIERS | ||
| &__important:not(.@{baseClass}__danger):not(.@{baseClass}__info):not(.@{baseClass}__success):not(.@{baseClass}__warning) { | ||
| --_no-bc: var(--_no-bg); | ||
| --_no-bg: var(--black-500); | ||
| &__important { | ||
| --_no-bg: var(--black-400); | ||
| --_no-icon-bg: var(--black-500); | ||
| --_no-fc: var(--white); | ||
| --_no-btn-bg-focus: var(--black-600); | ||
| --_no-btn-bg-active: var(--black-600); | ||
| --_no-btn-fc: var(--_no-fc); | ||
| --_no-code-bc: var(--black-300); | ||
| --_no-code-bg: var(--black-600); | ||
| --_no-code-bg: var(--black-500); | ||
| } | ||
|
|
||
| // VARIANTS | ||
|
|
@@ -103,11 +69,11 @@ | |
|
|
||
| &__info { | ||
| &:not(.@{baseClass}__important) { | ||
| .generate-variant-variables(theme-secondary); | ||
| .generate-variant-variables(blue); | ||
| } | ||
|
|
||
| &.@{baseClass}__important { | ||
| .generate-variant-variables(theme-secondary, important); | ||
| .generate-variant-variables(blue, important); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -121,33 +87,57 @@ | |
| } | ||
| } | ||
|
|
||
| &__featured { | ||
| &:not(.@{baseClass}__important) { | ||
| .generate-variant-variables(purple); | ||
| } | ||
|
|
||
| &.@{baseClass}__important { | ||
| .generate-variant-variables(purple, important); | ||
| } | ||
| } | ||
|
|
||
| &__activity { | ||
| &:not(.@{baseClass}__important) { | ||
| .generate-variant-variables(pink); | ||
| } | ||
|
|
||
| &.@{baseClass}__important { | ||
| .generate-variant-variables(pink, important); | ||
| } | ||
| } | ||
|
|
||
| &__warning { | ||
| &:not(.@{baseClass}__important) { | ||
| .generate-variant-variables(yellow); | ||
| --_no-btn-fc: var(--yellow-600); | ||
|
|
||
| } | ||
|
|
||
| &.@{baseClass}__important { | ||
| --_no-bc: var(--_no-bg); | ||
| --_no-bg: var(--yellow-400); | ||
| --_no-bg: var(--yellow-300); | ||
| --_no-icon-bg: var(--yellow-400); | ||
| --_no-fc: var(--black); | ||
| --_no-btn-fc: var(--_no-fc); | ||
| --_no-btn-bg-active: var(--yellow-300); | ||
| --_no-btn-bg-focus: var(--yellow-300); | ||
| --_no-code-bc: var(--yellow-500); | ||
| --_no-code-bg: var(--yellow-300); | ||
| --_no-code-bc: var(--yellow-400); | ||
| --_no-code-bg: var(--yellow-200); | ||
|
|
||
| .s-notice--icon { | ||
| color: var(--white); | ||
| } | ||
|
|
||
| .dark-mode({ | ||
| --_no-fc: var(--white); | ||
| --_no-code-bc: var(--yellow-300); | ||
| --_no-code-bg: var(--yellow-500); | ||
| --_no-bg: var(--yellow-400); | ||
| --_no-icon-bg: var(--yellow-500); | ||
| }); | ||
|
|
||
| .highcontrast-mode({ | ||
| --_no-bg: var(--yellow-500); | ||
| --_no-bg: var(--yellow-400); | ||
| --_no-icon-bg: var(--yellow-500); | ||
| --_no-code-bc: var(--yellow-300); | ||
| --_no-code-bg: var(--yellow-500); | ||
| --_no-fc: var(--white); | ||
| --_no-btn-bg-active: transparent; | ||
| --_no-btn-bg-focus: transparent; | ||
| }); | ||
| } | ||
| } | ||
|
|
@@ -157,41 +147,54 @@ | |
| background-color: var(--_no-code-bg); | ||
| color: var(--_no-code-fc); | ||
| outline: var(--su-static1) solid var(--_no-code-bc); | ||
|
|
||
| border-radius: var(--br-md); | ||
| padding-left: var(--su2); | ||
| padding-right: var(--su2); | ||
| } | ||
|
|
||
| & &--btn { | ||
| // TODO: decouple .s-notice--btn from .s-btn | ||
| button&--dismiss { | ||
| &:active { | ||
| background-color: var(--_no-btn-bg-active, inherit) !important; | ||
| background-color: var(--_no-fc); | ||
| color: var(--_no-bg); | ||
| } | ||
|
|
||
| &:focus-visible, | ||
| &:hover, | ||
| &.focus-inset-bordered { | ||
| background-color: var(--_no-btn-bg-focus, inherit) !important; | ||
| background-color: var(--_no-fc); | ||
| color: var(--_no-bg); | ||
| } | ||
|
|
||
| color: var(--_no-btn-fc, inherit) !important; | ||
| padding: var(--su8); | ||
| margin-left: calc(var(--su24) - var(--su2)); //22px | ||
| margin-right: var(--su12); | ||
|
|
||
| .svg-icon { | ||
| margin: 0px var(--su2) var(--su2) var(--su2); | ||
| } | ||
| } | ||
|
|
||
| // STYLES MODIFIED BY COMPONENT-SPECIFIC CUSTOM PROPERTIES | ||
| background: var(--_no-bg); | ||
| border-color: var(--_no-bc); | ||
| color: var(--_no-fc); | ||
|
|
||
| border-style: solid; | ||
| font-size: var(--fs-body1); | ||
| } | ||
|
|
||
| .s-notice { | ||
| .construct-notice-component(s-notice); | ||
|
|
||
| border-radius: var(--br-md); | ||
| border-width: var(--su-static1); | ||
| padding: var(--su16); | ||
| display: flex; | ||
| align-items: center; | ||
| gap: var(--su4); | ||
|
|
||
| &--icon { | ||
|
Collaborator
Author
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. Introduced the |
||
| background: var(--_no-icon-bg); | ||
| border: var(--su1) solid var(--_no-icon-bc, var(--_no-icon-bg)); | ||
| min-height: calc(var(--su32) + var(--su4)); //36px | ||
| height: 100%; | ||
| width: calc(var(--su32) + var(--su4)); //36px | ||
| padding: var(--su8); | ||
| margin-right: var(--su8); | ||
|
|
||
| //Center the svg icon | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
| } | ||
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
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-danger-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-danger.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-info-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-info.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-success-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-success.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-warning-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark-warning.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-dark.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
...cks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-danger-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-danger.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
...ges/stacks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
...tacks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-info-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-info.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
...ks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-success-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-success.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
...ks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-warning-important.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark-warning.ico
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/screenshots/Chromium/baseline/s-banner-highcontrast-dark.ico
Git LFS file not shown
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.
Introduced
s-notice--dismissclass here to make the dismiss button more explicit and style it accordingly.