Skip to content

Instantly share code, notes, and snippets.

@daphotron
Created October 24, 2014 22:03
Show Gist options
  • Save daphotron/68fd975c1da4dfe63756 to your computer and use it in GitHub Desktop.
Save daphotron/68fd975c1da4dfe63756 to your computer and use it in GitHub Desktop.
Sass for prototypes
//extends
%clearfix {
&:before,
&:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
%hxl {
@include hxl();
}
%h1 {
@include h1();
}
%h2 {
@include h2();
}
%h3 {
@include h3();
}
%h4 {
@include h4();
}
%h {
@include h();
}
%hxs {
@include hxs();
}
%hxxs {
font-size: $hxxs;
}
%bold {
font-weight: bold;
}
%subh {
@extend %hxs;
font-weight: 300;
color: $color-text-dim;
margin-top: 0.4em;
}
%bold {
font-weight: 700;
}
%normal {
font-weight: 400;
}
%thin {
font-weight: 300;
}
%label {
font-family: $font-tertiary;
text-transform: uppercase;
}
%align_center {
text-align: center;
}
%align_right {
text-align: right;
}
// backgrounds
%bg_under {
box-shadow: inset 0px 7px 7px -7px $color-shadow-light;
border-bottom-left-radius: 1em;
border-bottom-right-radius: 1em;
}
%bg_shadow_top {
@include bg_shadow_top();
}
%bg_shadow {
box-shadow: inset 0px -5px 7px -6px $color-shadow-light, inset 0px 5px 7px -6px $color-shadow-light;
}
%bg_shadow_over {
box-shadow: 0px 4px 5px 4px $color-shadow-dark;
}
%bg_result {
background: $white;
border: 1px solid $color-border-soft;
}
%input {
background: $white;
border: 2px solid $color-border-input;
border-radius: 3px;
font-size: 1em;
font-family: $font-primary;
margin: 0;
padding: 0.5em;
}
%icon {
line-height: 1.3;
&:before {
@extend .fa;
color: $color-bg-icon;
float: left;
min-height: 1.2em;
padding-right: 0.2em;
padding-top: 0.15em;
width: 1rem;
}
}
// bg
.bg {
background-color: $color-bg-field;
}
.bg_light {
background-color: $white;
}
.bg_dark {
background-color: $color-bg-dark;
}
// boxes
.box {
background: $white;
border: 1px solid $color-border-soft;
border-radius: $size-radius;
padding: 1.5em;
position: relative;
}
// buttons
%button {
background: none;
border-radius: $size-radius-small;
cursor: pointer;
display: inline-block;
padding: 0.5em 1em;
text-decoration: none;
@include transition (all 0.2s ease-in-out);
&[disabled] {
opacity: 0.6;
}
}
button {
border-radius: $size-radius-small;
background: none;
@extend %hxs;
}
.btn {
@extend %button;
border: 1px dotted $color-btn-primary;
color: $color-btn-primary;
&:hover {
color: #fff;
cursor: pointer;
background: $color-btn-primary;
border-color: $color-btn-primary;
}
}
.btn_action {
@extend %button;
@extend %hxs;
background: $color-btn-primary;
border: 0;
box-shadow: 0 1px 0 1px darken($color-btn-primary, 5%);
color: #fff;
position: relative;
z-index: 1;
&:hover,
&:focus {
background: darken($color-btn-primary, 10%);
}
&[disabled]:hover {
background: $color-btn-primary;
}
}
@import '_grid.scss';
@import '_vars.scss';
@import "font-awesome/scss/_variables.scss";
* {
box-sizing: border-box;
}
// ~HELPERS
//=========================================
.hidden {
display: none;
}
// ~clearfix
.clearfix:before,
.clearfix:after,
.step:before,
.step:after,
.field_wrapper:before,
.field_wrapper:after {
content: " ";
display: table;
}
.clearfix:after,
.step:after,
.field_wrapper:after {
clear: both;
}
.clear {
clear: both;
}
.left {
@media (min-width: $bp-wide) {
float: left;
}
}
.right {
@media (min-width: $bp-wide) {
float: right;
}
}
.relative {
position: relative;
}
.inline_block {
display: inline-block;
}
.align_center {
text-align: center;
}
.align_right {
text-align: right;
}
// radius
.rad {
border-radius: $size-radius-small;
}
.rad_l {
border-radius: $size-radius;
}
// padding
.pad_s {
padding: 0.5em;
}
.pad {
padding: 1em;
}
.pad_m {
padding: 1.5em;
}
.pad_l {
padding: 2em;
}
.pad_bottom_s {
padding-bottom: 0.5em;
}
.pad_bottom {
padding-bottom: 1em;
}
.pad_bottom_m {
padding-bottom: 1.5em;
}
.pad_bottom_l {
padding-bottom: 2em;
}
.pad_top_s {
padding-top: 0.5em;
}
.pad_top {
padding-top: 1em;
}
.pad_top_m {
padding-top: 1.5em;
}
.pad_top_l {
padding-top: 2em;
}
.pad_right_s {
padding-right: 0.5em;
}
.pad_right {
padding-right: 1em;
}
.pad_right_m {
padding-right: 1.5em;
}
.pad_right_l {
padding-right: 2em;
}
.pad_left_s {
padding-left: 0.5em;
}
.pad_left {
padding-left: 1em;
}
.pad_left_m {
padding-left: 1.5em;
}
.pad_left_l {
padding-left: 2em;
}
// margins
.gap_s {
margin: 0.5em;
}
.gap {
margin: 1em;
}
.gap_m {
margin: 1.5em;
}
.gap_l {
margin: 2em;
}
.gap_bottom_s {
margin-bottom: 0.5em;
}
.gap_bottom {
margin-bottom: 1em;
}
.gap_bottom_m {
margin-bottom: 1.5em;
}
.gap_bottom_l {
margin-bottom: 2em;
}
.gap_top_s {
margin-top: 0.5em;
}
.gap_top {
margin-top: 1em;
}
.gap_top_m {
margin-top: 1.5em;
}
.gap_top_l {
margin-top: 2em;
}
.gap_right_s {
margin-right: 0.5em;
}
.gap_right {
margin-right: 1em;
}
.gap_right_m {
margin-right: 1.5em;
}
.gap_right_l {
margin-right: 2em;
}
.gap_left_s {
margin-left: 0.5em;
}
.gap_left {
margin-left: 1em;
}
.gap_left_m {
margin-left: 1.5em;
}
.gap_left_l {
margin-left: 2em;
}
// border
.border {
border: 1px solid $color-border-soft;
}
.border_top {
border-top: 1px solid $color-border-soft;
}
.border_right {
border-right: 1px solid $color-border-soft;
}
.border_bottom {
border-bottom: 1px solid $color-border-soft;
}
.border_left {
border-left: 1px solid $color-border-soft;
}
// type
.h1 {
@extend %h1;
}
.h2 {
@extend %h2;
}
.h3 {
@extend %h3;
}
.h4 {
@extend %h4;
}
.hxs {
@extend %hxs;
}
.hxxs {
@extend %hxxs;
}
.subh {
@extend %subh;
}
.bold {
@extend %bold;
}
.thin {
@extend %thin;
}
@import "_vars.scss";
html {
font-size: 1em;
}
body {
background-color: $color-bg-body;
color: $color-text;
font-family: $font-primary;
font-weight: 400;
line-height: 1.45;
margin: 0;
padding: 0;
}
a {
border-bottom: 1px dotted transparentize($color-link, 0.3);
color: $color-link;
cursor: pointer;
text-decoration: none;
&:hover {
border-color: transparent;
}
}
p {
margin-bottom: 1.3em;
}
h1, h2, h3, h4 {
margin: 1.414em 0 0.5em;
font-weight: inherit;
line-height: 1.2;
}
h1 {
margin-top: 0;
@extend %h1;
}
h2 {
@extend %h2;
}
h3 {
@extend %h3;
}
h4 {
@extend %h4;
}
small, .font_small {
@extend %hxs;
}
// LISTS
// =========================================
ol,
ul {
padding: 0;
margin: 0;
}
li {
list-style-type: none;
}
table {
border-collapse: collapse;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment