This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Clean up base PL styles #236
Merged
Merged
Changes from all commits
Commits
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 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
13 changes: 0 additions & 13 deletions
13
components/_patterns/00-base/global/02-animations/_animation.scss
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
components/_patterns/00-base/global/animations/_animation.scss
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,22 @@ | ||
/// Mixin - Transition | ||
@mixin transition($transition-property, $transition-time, $method) { | ||
-webkit-transition: $transition-property $transition-time $method; | ||
-moz-transition: $transition-property $transition-time $method; | ||
-ms-transition: $transition-property $transition-time $method; | ||
-o-transition: $transition-property $transition-time $method; | ||
transition: $transition-property $transition-time $method; | ||
} | ||
|
||
.animate-fade { | ||
@include transition(opacity, 0.3s, ease-out); | ||
|
||
&:hover { | ||
opacity: 0; | ||
} | ||
} | ||
|
||
.animate-move { | ||
> .demo-shape { | ||
@include transition(all, 0.8s, ease-in-out); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
///////////////////// | ||
// General Mixins (put specific ones in component files where applicable) | ||
|
||
/// Mixin - Clearfix. | ||
/// Adds clearfix based on http://bourbon.io/docs/#clearfix | ||
/// use example = @include cleafix | ||
|
||
@mixin clearfix { | ||
&::after { | ||
clear: both; | ||
content: ""; | ||
display: table; | ||
} | ||
} | ||
|
||
/// Mixin - Wrapper | ||
/// Outer container mixin for large screens | ||
@mixin wrapper($container-max-width: $max-width, $outer-container-break: $small, $v-margin: 0, $v-padding: 0, $h-padding: $space, $h-padding-large: $h-padding) { | ||
max-width: #{$container-max-width}; | ||
width: 100%; | ||
margin: #{$v-margin} auto; | ||
padding: #{$v-padding} #{$h-padding}; | ||
|
||
@include breakpoint($outer-container-break) { | ||
padding: #{$v-padding} #{$h-padding-large}; | ||
} | ||
|
||
@include breakpoint($container-max-width) { | ||
padding-left: calc(#{$h-padding-large} + calc(-50vw + calc(#{$container-max-width} / 2))); | ||
padding-right: calc(#{$h-padding-large} + calc(-50vw + calc(#{$container-max-width} / 2))); | ||
} | ||
} | ||
|
||
/// Use the breakout mixin for elements that should be edge-to-edge | ||
/// Even when a parent container uses the wrapper mixin | ||
@mixin breakout($v-padding: $space-double) { | ||
margin-left: calc(-50vw + 50%); | ||
margin-right: calc(-50vw + 50%); | ||
padding-left: calc(#{$v-padding} + calc(-50vw + 50%)); | ||
padding-right: calc(#{$v-padding} + calc(-50vw + 50%)); | ||
} | ||
|
||
/// Mixin - Standard Margin | ||
@mixin margin { | ||
margin-bottom: 1em; | ||
} | ||
|
||
@mixin no-bottom { | ||
margin-bottom: 0; | ||
} |
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,5 @@ | ||
.main { | ||
@include wrapper; | ||
|
||
display: block; // Fix for IE weirdness | ||
} |
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,82 @@ | ||
// These styles are specifically for Pattern Lab. | ||
// They are not used by the site in any way. | ||
|
||
.sg-main { | ||
@include wrapper; | ||
} | ||
|
||
.pl-template { | ||
display: flex; | ||
flex-flow: column nowrap; | ||
} | ||
|
||
.pl, | ||
.sg-main { | ||
.sg-subtype h2 { | ||
font-size: 3rem; | ||
text-transform: uppercase; | ||
background-color: $gray-darker; | ||
margin: 0 calc(-50vw + 50%) $space calc(-50vw + 50%); | ||
|
||
a { | ||
@include wrapper( | ||
$v-padding: $space | ||
); | ||
|
||
display: block; | ||
color: $white; | ||
text-decoration: none; | ||
line-height: 1; | ||
} | ||
} | ||
|
||
.sg-pattern-title { | ||
color: #738ba3; | ||
font-size: 1.4rem !important; | ||
text-transform: none !important; | ||
|
||
a { | ||
color: #1169ba !important; | ||
font-family: Calibre; | ||
font-size: 2.2rem; | ||
font-weight: 500; | ||
text-transform: uppercase !important; | ||
} | ||
} | ||
|
||
.sg-pattern-extra-info { | ||
width: 100%; | ||
} | ||
|
||
.sg-pattern-extra-code { | ||
display: none; | ||
} | ||
|
||
.visually-hidden { | ||
position: absolute !important; | ||
clip: rect(1px, 1px, 1px, 1px); | ||
overflow: hidden; | ||
height: 1px; | ||
width: 1px; | ||
word-wrap: normal; | ||
} | ||
|
||
.sg-colors { | ||
display: flex; | ||
flex-wrap: wrap; | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
|
||
li { | ||
flex: 0 0 100px; | ||
margin: 0 0.5rem 1rem; | ||
} | ||
|
||
&__sample { | ||
display: block; | ||
height: 100px; | ||
margin-bottom: 0.3em; | ||
} | ||
} | ||
} |
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.
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.
What do you think about separating all the full-width pieces out into a gist? I like the code, but this is really a project-specific need and makes the wrapper mixin a little less approachable.
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.
The breakout mixin doesn't affect the wrapper mixin in any way. The wrapper mixin will stay exactly the same, even if we remove the breakout mixin.
I'd like to keep the breakout in here. Maybe I just need to record a quick "Here's how to use this" video, or write a blogpost.
I don't think it's project-specific, it's just "any time you have a broad-context container (like
body
ormain
) and you need a way to have a full-width element, this is how you do it.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.
No worries - it was a minor nitpick to begin with. More prescriptive than my taste for Emulsify "core," but you're right about it not simplifying the breakout mixin. I was thinking we could get rid of some of the breakout mixin args, but you're using them all anyway.
I don't think a post/video is necessary for such a small piece of code (although showing off how it was used on a client project might be cool). It might not hurt to add some CSS comments or a link to someone else's post in the code (not necessary but maybe helpful for someone who hadn't come across that technique).