-
-
Notifications
You must be signed in to change notification settings - Fork 61
Move Granite specific button styles to Granite Dir #872
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 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
96c328e
Move granite specific styles to file under granite dir
wpkelso 4956806
use extend rule
wpkelso e422f16
Merge branch 'main' into wpkelso/styles/granite-button
wpkelso dc4955d
use emphemeral style class
wpkelso d558b7c
Merge branch 'main' into wpkelso/styles/granite-button
wpkelso b5539f0
Merge branch 'main' into wpkelso/styles/granite-button
wpkelso 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| button { | ||
| .linked &, | ||
| .linked &.image-button, | ||
| .linked &.image-button.toggle { | ||
| @extend .text-button; | ||
|
|
||
| // Overwrite changes made further down the cascade due to the way | ||
| // @extend works | ||
| padding: 0; | ||
|
|
||
| &:active, | ||
| &:checked { | ||
| @include control-active; | ||
|
|
||
| color: $fg-color; | ||
| filter: brightness(95%); | ||
| } | ||
| } | ||
|
|
||
| &.osd { | ||
| @include control; | ||
| @include border-interactive-roundrect; | ||
|
|
||
| // This stacks with the other shadows, | ||
| // so reduce it's alpha by the sum of other shadows | ||
| $shadow-border-color: scale-color($border-color, $alpha: -50%); | ||
| @if $color-scheme == "dark" { | ||
| $shadow-border-color: transparent | ||
| } | ||
|
|
||
| background-image: none; | ||
| border: none; | ||
| box-shadow: | ||
| highlight(), | ||
| // Intentionally not in ems since it's used as a stroke | ||
| 0 0 0 1px $shadow-border-color, | ||
| shadow(2); | ||
| color: $fg-color; | ||
| margin: 0; | ||
| padding: $button-spacing; | ||
|
|
||
| transition: | ||
| background duration("expand") easing(), | ||
| transform duration("expand") easing("ease-out-back"); | ||
|
|
||
| &:active { | ||
| transition: | ||
| background duration("collapse") easing(), | ||
| transform duration("collapse") easing(); | ||
| } | ||
|
|
||
| &:disabled { | ||
| @include control-disabled; | ||
|
|
||
| box-shadow: | ||
| highlight(), | ||
| // Intentionally not in ems since it's used as a stroke | ||
| 0 0 0 1px $shadow-border-color, | ||
| shadow(1); | ||
| } | ||
|
|
||
| .linked & { | ||
| transition: none; | ||
| transform: none; | ||
| } | ||
|
|
||
| .linked &.vertical &:first-child { | ||
| box-shadow: | ||
| highlight("top"), | ||
| // Intentionally not in ems since it's used as a stroke | ||
| 0 0 0 1px $shadow-border-color, | ||
| shadow(2); | ||
| } | ||
| } | ||
|
|
||
| } | ||
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
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.
This padding removal seems like an error?
Main:


This branch:


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.
button.text-buttonsets a padding ofrem(2px) rem(4px), which then gets inherited when we extend it. This is supposed to override that and reset the padding. Before, we got around this by setting the padding for.text-buttonin a block specific to.text-button, and setting everything else in a shared block.Compiled as it currently is, the padding is not being overridden. I'm not really sure why, though. Sheets might be cascading in a way I'm not expecting?
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.
I see what you're saying. Because we want text buttons to have more horizontal padding and image buttons to have even padding all the way around.
Maybe what we need to do instead then is have a
.raisedstyle that just handles the borders and have .linked and .text-button extend that, separatelyThere 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.
I've split it out using a placeholder class. For some reason the checked and active selectors still had to be overriden