-
Notifications
You must be signed in to change notification settings - Fork 2
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
Split pattern library SASS and remove remaining resets and element styles #212
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 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 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 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 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 was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
@use 'reset'; | ||
@use 'elements'; | ||
@use 'normalize.css/normalize'; | ||
|
||
* { | ||
box-sizing: border-box; | ||
|
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,174 @@ | ||
/** | ||
* This stylesheet contains styles for pattern-library components. | ||
*/ | ||
@use 'variables' as var; | ||
@use './mixins/layout'; | ||
@use './mixins/atoms'; | ||
@use './mixins/patterns/containers'; | ||
|
||
.Library { | ||
&__heading2 { | ||
border-left: 6px solid var.$color-brand; | ||
padding-left: 0.5em; | ||
} | ||
|
||
&__heading3 { | ||
font-weight: normal; | ||
font-style: italic; | ||
} | ||
|
||
&__heading4 { | ||
font-style: italic; | ||
} | ||
Comment on lines
+10
to
+22
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'm not married to this naming convention going forward; it's an interim step of isolating these styles. |
||
} | ||
|
||
.PlaygroundApp { | ||
display: grid; | ||
grid-template-areas: | ||
'navigation' | ||
'content'; | ||
|
||
&__content { | ||
padding: 1em; | ||
} | ||
|
||
&__sidebar { | ||
grid-area: 'navigation'; | ||
max-height: 20em; | ||
overflow: scroll; | ||
background-color: var.$color-grey-2; | ||
} | ||
|
||
&__sidebar-home { | ||
text-align: center; | ||
padding: 1em; | ||
} | ||
|
||
&__nav { | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
&__content { | ||
grid-area: 'content'; | ||
} | ||
} | ||
|
||
.PlaygroundApp__nav-item { | ||
width: 100%; | ||
padding: 1em 2em; | ||
font-size: 16px; // TODO: variable later | ||
&:hover { | ||
background-color: var.$color-grey-3; | ||
} | ||
|
||
&.is-active { | ||
background-color: var.$color-grey-3; | ||
} | ||
} | ||
|
||
// Element styles | ||
body { | ||
font-family: sans-serif; | ||
} | ||
|
||
@media screen and (min-width: 60em) { | ||
.PlaygroundApp { | ||
height: 100vh; | ||
grid-template-columns: 20em auto; | ||
column-gap: 1em; | ||
grid-template-areas: 'navigation content'; | ||
|
||
&__sidebar { | ||
max-height: none; | ||
} | ||
} | ||
} | ||
|
||
$-library-vertical-spacing: 7; | ||
.LibraryPage { | ||
// Make sure the content width is not too terribly wide: it gets hard to read | ||
max-width: 75rem; | ||
@include layout.vertical-spacing($size: $-library-vertical-spacing); | ||
// A little breathing room at the bottom of the page, as we don't have | ||
// a footer. | ||
// TODO: Consolidate padding after removal in future of `PlaygroundApp` styling | ||
@include layout.padding($side: top, $size: 5); | ||
@include layout.padding($side: bottom, $size: 7); | ||
} | ||
|
||
.LibraryPattern { | ||
@include layout.vertical-spacing($size: $-library-vertical-spacing); | ||
@include atoms.border(top); | ||
// The following balances out spacing above and below border | ||
@include layout.padding($size: $-library-vertical-spacing, $side: top); | ||
} | ||
|
||
.LibraryExample { | ||
// Narrower screen/default shows single column | ||
@include layout.vertical-spacing($size: $-library-vertical-spacing); | ||
} | ||
|
||
@mixin library-row { | ||
// Turn off any applied vertical spacing | ||
@include layout.vertical-spacing($size: 0); | ||
@include layout.row; | ||
@include layout.horizontal-spacing($size: 5); | ||
} | ||
|
||
.LibraryExample--split { | ||
// Wider screen shows description and demo side-by-side (where space allows) | ||
@media screen and (min-width: 60em) { | ||
@include library-row; | ||
|
||
.LibraryExample__content, | ||
.LibraryExample__demos { | ||
width: 50%; | ||
@include layout.vertical-spacing($size: $-library-vertical-spacing); | ||
} | ||
} | ||
} | ||
|
||
.LibraryExample--wide { | ||
// Show example content full width, and then a row containing demos | ||
// side-by-side (where space allows) | ||
.LibraryExample__demos { | ||
@include layout.vertical-spacing($size: $-library-vertical-spacing); | ||
|
||
@media screen and (min-width: 60em) { | ||
@include library-row; | ||
} | ||
} | ||
} | ||
|
||
.LibraryDemo { | ||
// When laid out in a row, make demos share space evenly | ||
flex: 1 1 0px; | ||
|
||
&__tabs { | ||
@include layout.row; | ||
@include layout.horizontal-spacing; | ||
// Pull the buttons down into the top of the `container` element below, | ||
// so that they look like tabs | ||
margin-bottom: -1px; | ||
} | ||
|
||
&__container { | ||
@include layout.padding($size: 5, $side: top); | ||
@include atoms.border(top); | ||
@include layout.row($align: center, $justify: center); | ||
// Make the demo take up at least a minimal amount of vertical space | ||
min-height: 8rem; | ||
} | ||
|
||
&__source, | ||
&__demo { | ||
width: 100%; | ||
} | ||
|
||
&__demo-content { | ||
@include layout.row($align: center, $justify: center); | ||
@include layout.horizontal-spacing; | ||
} | ||
} |
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.
These styles we extracted from
pattern-library.scss