-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(elevation): sharp or rounded shape #1185
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
@use 'sass:list'; | ||
|
||
$dps: 0 2 4 8 12 16 24; | ||
$vvd-elevation-background-color: --vvd-elevation-background-color; | ||
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. These constants prevent typos that may occur by authoring "magic strings". 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. I removed that line anyway :) 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. right, don't. it helps ensure we use the right css variable. rule of thumb |
||
$vvd-elevation-border-radius: --vvd-elevation-border-radius; | ||
|
||
@function get-default-selector($list, $default) { | ||
@if list.length($list) == 1 { | ||
|
@@ -20,13 +18,18 @@ $vvd-elevation-border-radius: --vvd-elevation-border-radius; | |
|
||
@each $dp in $dps { | ||
#{get-default-selector($dps, $dp)} { | ||
background-color: var(#{$vvd-elevation-background-color}, var(--vvd-color-surface-#{$dp}dp)); | ||
background-color: var(--vvd-color-surface-#{$dp}dp); | ||
filter: var(--vvd-shadow-surface-#{$dp}dp); | ||
} | ||
} | ||
|
||
.vwc-elevation { | ||
--border-radius-size: 6px; | ||
width: fit-content; | ||
border-radius: var(#{$vvd-elevation-border-radius}, 6px); | ||
border-radius: var(--border-radius-size); | ||
contain: content; | ||
|
||
&-sharp { | ||
--border-radius-size: 0; | ||
} | ||
} |
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.
Shouldn't this be coming from tokens automatically?
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.
not sure what you mean. This is for the sass loop :)
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.
probably not related to this PR, but the values are hardcoded here instead of being imported from style tokens
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.
That what was there - I merely added the 0 ;)