Skip to content

Instantly share code, notes, and snippets.

@frankpinto
Last active January 23, 2017 19:16
Show Gist options
  • Save frankpinto/b8e4c832ea3ef9d6f49d797ec40b2d9a to your computer and use it in GitHub Desktop.
Save frankpinto/b8e4c832ea3ef9d6f49d797ec40b2d9a to your computer and use it in GitHub Desktop.
Utilities that I use in several projects
/* Alerts */
.flash {
max-width: 100%;
margin: 0 auto;
padding: 15px 20px;
text-align: center;
&.success {
color: #333;
background-color: $brand-success;
}
&.error {
color: #333;
background-color: $brand-danger;
}
}
/* Display and Alignment */
.d-none, .hidden {
display: none;
}
.d-block {
display: block;
}
.d-inline-block, .dib {
display: inline-block;
vertical-align: top;
}
.o-hidden {
overflow: hidden;
}
.o-auto {
overflow: auto;
}
/* Alignment */
.middle {
vertical-align: middle;
}
.centered {
display: block;
margin: 0 auto;
}
.a-left {
text-align: left;
}
.a-center {
text-align: center;
}
.a-right {
text-align: right;
}
/* Width and Sizing */
.w-quarter {
width: 25%;
}
.w-half {
width: 50%;
}
.w-full {
width: 100%;
}
/* Positioning */
.p-fixed {
position: fixed;
}
.p-absolute {
position: absolute;
}
.p-relative {
position: relative;
}
.f-none {
float: none;
}
.f-left {
float: left;
}
.f-right {
float: right;
}
/* Margins */
.mt-5 {
margin-top: 5px;
}
.mt-10, .mt {
margin-top: 10px;
}
.mt-15 {
margin-top: 15px;
}
.mt-30 {
margin-top: 30px;
}
.mb-5 {
margin-bottom: 5px;
}
.mb-10 {
margin-bottom: 10px;
}
.mb-15, .mb {
margin-bottom: 15px;
}
.mb-30 {
margin-bottom: 30px;
}
.ml-15, .ml {
margin-left: 15px;
}
.ml-30 {
margin-left: 30px;
}
.mr-15, .mr {
margin-right: 15px;
}
.mr-30 {
margin-right: 30px;
}
/* Font sizing */
.f-small {
font-size: 1.1rem;
}
.f-large {
font-size: 1.8rem;
}
/* Misc */
.outline {
border: 2px solid #fff;
}
.i-transparent {
border: 0;
background-color: transparent;
}
.clickable {
cursor: pointer;
}
.origin-position {
top: 0;
bottom: 0;
right: 0;
left: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment