Skip to content

Instantly share code, notes, and snippets.

@CheetoMao
Created September 19, 2014 00:02
Show Gist options
  • Save CheetoMao/b45547e8ca02e10afe02 to your computer and use it in GitHub Desktop.
Save CheetoMao/b45547e8ca02e10afe02 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<body>
<section class="Wrapper">
<h1>Lorem ipsum dolor sit amet</h1>
<div class="Container">
<p>Consectetur adipiscing elit. Nulla tristique lorem consequat magna ultrices, eget lobortis erat elementum. Pellentesque gravida lacinia vehicula. Cras ut nibh eu elit maximus iaculis. Cras volutpat tortor eu ipsum bibendum pulvinar. Phasellus at scelerisque leo. Vestibulum ornare volutpat dictum.</p>
<button class="base-color">Button</button>
<button class="secondary-color">Secondary Button</button>
</div>
</section>
</body>
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
$base-color: #2980b9;
$base-color-dark: darken($base-color, 35%);
$secondary-color: adjust-hue($base-color, 240);
$tertiary-color: tint($base-color, 85%);
//adjust the button font color based on the button background color
@function button-copy($color) {
@if (lightness($color) > 50) {
@return #000000;
} @else {
@return #ffffff;
}
}
body {
background: $base-color-dark;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.Wrapper {
background: $tertiary-color;
margin: 0 auto;
max-width: 600px;
}
.Container {
overflow: hidden;
padding: 20px;
}
h1 {
background: $base-color;
color: $base-color-dark;
margin: 0;
padding: 20px;
text-transform: uppercase;
}
p {
color: $base-color-dark;
line-height: 1.5em;
}
button {
border: none;
float: left;
font-size: 1rem;
outline: 0;
padding: 1rem;
box-shadow: 0;
&:hover {
cursor: pointer;
}
&.base-color {
background: $base-color;
color: button-copy($base-color);
&:hover {
background: lighten($base-color, 10%);
}
}
&.secondary-color {
background: $secondary-color;
color: button-copy($secondary-color);
&:hover {
background: lighten($secondary-color, 10%);
}
}
}
body {
background: #091b27;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.Wrapper {
background: #deebf4;
margin: 0 auto;
max-width: 600px;
}
.Container {
overflow: hidden;
padding: 20px;
}
h1 {
background: #2980b9;
color: #091b27;
margin: 0;
padding: 20px;
text-transform: uppercase;
}
p {
color: #091b27;
line-height: 1.5em;
}
button {
border: none;
float: left;
font-size: 1rem;
outline: 0;
padding: 1rem;
box-shadow: 0;
}
button:hover {
cursor: pointer;
}
button.base-color {
background: #2980b9;
color: #ffffff;
}
button.base-color:hover {
background: #409ad5;
}
button.secondary-color {
background: #80b929;
color: #ffffff;
}
button.secondary-color:hover {
background: #9ad540;
}
<body>
<section class="Wrapper">
<h1>Lorem ipsum dolor sit amet</h1>
<div class="Container">
<p>Consectetur adipiscing elit. Nulla tristique lorem consequat magna ultrices, eget lobortis erat elementum. Pellentesque gravida lacinia vehicula. Cras ut nibh eu elit maximus iaculis. Cras volutpat tortor eu ipsum bibendum pulvinar. Phasellus at scelerisque leo. Vestibulum ornare volutpat dictum.</p>
<button class="base-color">Button</button>
<button class="secondary-color">Secondary Button</button>
</div>
</section>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment