-
Notifications
You must be signed in to change notification settings - Fork 10
feat(chip): add outlined version #2307
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
base: master
Are you sure you want to change the base?
Changes from all commits
dd73c80
05da111
302d081
ec10660
177bac9
File filter
Filter by extension
Conversations
Jump to
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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,17 @@ $theme: $bootstrap; | |
| :host { | ||
| @include css-vars-from-theme(diff(light.$base, $theme)); | ||
| } | ||
|
|
||
| @mixin chip-outlined-variants-dark($variant, $variant-color, $border-shade) { | ||
| :host([outlined][variant='#{$variant}']) button, | ||
| :host([selected][outlined][variant='#{$variant}']) button:not([disabled]) { | ||
| border-color: color($variant-color, $border-shade); | ||
| color: contrast-color(gray, 100); | ||
|
Comment on lines
+14
to
+15
Collaborator
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. Interesting approach, I've thought those colors should be derived from the component schema, not hand written here. |
||
| } | ||
| } | ||
|
|
||
| @include chip-outlined-variants-dark('primary', primary, 300); | ||
| @include chip-outlined-variants-dark('info', info, 600); | ||
| @include chip-outlined-variants-dark('success', success, 200); | ||
| @include chip-outlined-variants-dark('warning', warn, 500); | ||
| @include chip-outlined-variants-dark('danger', error, 400); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,25 @@ $theme: $fluent; | |
| :host { | ||
| @include css-vars-from-theme(diff(light.$base, $theme)); | ||
| } | ||
|
|
||
| @mixin chip-outlined-variants-dark($variant, $variant-color, $border-shade, $color-shade) { | ||
| :host([outlined][variant='#{$variant}']) button, | ||
| :host([selected][outlined][variant='#{$variant}']) button:not([disabled]) { | ||
| border-color: color($variant-color, $border-shade); | ||
| color: contrast-color($variant-color, $color-shade); | ||
|
|
||
| &:focus { | ||
| background: color($variant-color, 800, .50); | ||
| } | ||
|
|
||
| &:hover { | ||
| background: color($variant-color, 600, .20); | ||
| } | ||
|
Comment on lines
+16
to
+23
Collaborator
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. Same comment as the one above. |
||
| } | ||
| } | ||
|
|
||
| @include chip-outlined-variants-dark('primary', primary, 200, 600); | ||
| @include chip-outlined-variants-dark('info', info, 200, 500); | ||
| @include chip-outlined-variants-dark('success', success, 100, 600); | ||
| @include chip-outlined-variants-dark('warning', warn, 200, 500); | ||
| @include chip-outlined-variants-dark('danger', error, 50, 600); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,14 +36,54 @@ $theme: $indigo; | |
| } | ||
| } | ||
|
|
||
| :host([variant='warning']) button[disabled], | ||
| :host([selected][variant='warning']) button[disabled] { | ||
| color: color(gray, 50); | ||
| } | ||
|
|
||
| :host([variant='danger']) button, | ||
| :host([selected][variant='danger']) button:not([disabled]) { | ||
| &:focus { | ||
| box-shadow: 0 0 0 rem(3px) color(error, 900); | ||
| } | ||
| } | ||
|
|
||
| :host([selected]) button[disabled], | ||
| :host([variant='primary']) button[disabled] { | ||
| :host([variant='primary']) button[disabled], | ||
| :host([selected][variant='primary']) button[disabled] { | ||
| color: contrast-color(primary, 900, .2); | ||
| } | ||
|
|
||
| @mixin chip-outlined-variants-dark($variant, $variant-color, $border-shade) { | ||
| :host([outlined][variant='#{$variant}']) button, | ||
| :host([selected][outlined][variant='#{$variant}']) button:not([disabled]) { | ||
| border-color: color($variant-color, $border-shade); | ||
| color: contrast-color(gray, 100); | ||
|
|
||
| &:hover { | ||
| @if $variant == 'success' { | ||
| background: color($variant-color, 700, .30); | ||
| } @else if $variant == 'danger' { | ||
| background: color($variant-color, 500, .30); | ||
| } @else { | ||
| background: color($variant-color, 400, .30); | ||
| } | ||
|
Collaborator
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. Same comment as the one above. |
||
| } | ||
|
|
||
| &:focus { | ||
| background: transparent; | ||
| } | ||
| } | ||
|
|
||
| :host([outlined][variant='#{$variant}']) button[disabled], | ||
| :host([selected][outlined][variant='#{$variant}']) button[disabled] { | ||
| background: transparent; | ||
| border-color: color($variant-color, $border-shade); | ||
| color: contrast-color(gray, 100); | ||
| } | ||
| } | ||
|
|
||
| @include chip-outlined-variants-dark('primary', primary, 400); | ||
| @include chip-outlined-variants-dark('info', info, 300); | ||
| @include chip-outlined-variants-dark('success', success, 500); | ||
| @include chip-outlined-variants-dark('warning', warn, 300); | ||
| @include chip-outlined-variants-dark('danger', error, 400); | ||
Uh oh!
There was an error while loading. Please reload this page.