-
Notifications
You must be signed in to change notification settings - Fork 70
Clean up base PL styles #236
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
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); | ||
} | ||
} |
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; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.main { | ||
@include wrapper; | ||
|
||
display: block; // Fix for IE weirdness | ||
} |
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; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/// Mixin - With Icon | ||
/// Precede Text with SVG icon | ||
@mixin with-icon { | ||
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. Pretty sure we don't need this anymore. This was harder with SVG in the CSS background and doesn't apply to the new setup using the SVG element. 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. Cool. I'll delete this file. I didn't know, so I didn't want to remove code that I wasn't familiar with. 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. @evanmwillhite Do all of the other icon files stay there? e.g. Am I just deleting this scss file? 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. yep! |
||
background-size: cover; | ||
content: ""; | ||
display: inline-block; | ||
margin-right: 0.1em; | ||
padding: 0.8em; | ||
} |
This file was deleted.
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).