KNACSS/sass/_01-base.scss

656 lines
7.8 KiB
SCSS
Raw Normal View History

2014-05-04 15:48:00 +02:00
/*!
2014-09-12 09:40:29 +02:00
* www.KNACSS.com V3.0.9 (2014-09-12) @author: Raphael Goetter, Alsacreations (with help from Hugo Giraudel)
2014-05-04 15:48:00 +02:00
* Licence WTFPL http://www.wtfpl.net/
*/
/* ----------------------------- */
/* == soft reset */
/* ----------------------------- */
/* switching box model for all elements */
* {
box-sizing: border-box;
}
/* soft reset */
html,
body {
margin: 0;
padding: 0;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
ul,
ol {
padding-left: 2em;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
ul.unstyled {
list-style: none;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
img {
height: auto;
vertical-align: middle;
border: 0;
}
2014-05-07 11:12:14 +02:00
2014-07-10 16:06:02 +02:00
blockquote,
figure {
margin-left: 0;
margin-right: 0;
}
2014-05-04 15:48:00 +02:00
audio,
canvas,
video {
display: inline-block;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
svg:not(:root) {
overflow: hidden;
}
/* ----------------------------- */
/* == typography */
/* ----------------------------- */
html {
2014-05-19 10:46:39 +02:00
/* set base font-size to equiv "10px", which is adapted to rem unit */
2014-05-04 15:48:00 +02:00
font-size: 62.5%;
2014-05-19 10:46:39 +02:00
/* IE9-IE11 math fixing. See http://bit.ly/1g4X0bX */
/* thanks to @guardian, @victorbritopro and @eQRoeil */
font-size: calc(1em * 0.625);
/* disallow text zooming on orientation change (non standard property) */
2014-05-04 15:48:00 +02:00
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
body {
2014-05-19 10:46:39 +02:00
/* set body font-size in em (1.4em equiv "14px") */
font-size: ($base-font-size / 10px) + em;
2014-07-02 16:12:58 +02:00
background-color: $base-background;
color: $base-color;
2014-05-04 15:48:00 +02:00
font-family: $font-stack-common;
line-height: $line-height;
}
2014-06-30 21:20:07 +02:00
a {
2014-07-02 16:12:58 +02:00
color: $base-color-link;
2014-06-30 21:20:07 +02:00
&:hover, &:focus, &:active {
2014-07-02 16:12:58 +02:00
color: $base-color-link-hover;
2014-06-30 21:20:07 +02:00
}
}
2014-05-04 15:48:00 +02:00
/* font-sizing for content */
p,
.p-like,
ul,
ol,
dl,
blockquote,
pre,
td,
th,
label,
textarea,
caption,
details,
2014-05-07 11:12:14 +02:00
figure {
2014-05-04 15:48:00 +02:00
margin-top: 0.75em;
margin-bottom: 0;
line-height: $line-height;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
h1, .h1-like {
font-size: $h1-size;
2014-07-02 16:12:58 +02:00
font-family: $font-stack-headings;
2014-05-04 15:48:00 +02:00
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
h2, .h2-like {
font-size: $h2-size;
2014-07-02 16:12:58 +02:00
font-family: $font-stack-headings;
2014-05-04 15:48:00 +02:00
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
h3, .h3-like {
font-size: $h3-size;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
h4, .h4-like {
font-size: $h4-size;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
h5, .h5-like {
font-size: $h5-size;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
h6, .h6-like {
font-size: $h6-size;
}
/* alternate font-sizing */
.smaller {
@include em($base-font-size / 1px - 4);
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
.small {
@include em($base-font-size / 1px - 2);
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
.big {
@include em($base-font-size / 1px + 2);
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
.bigger {
@include em($base-font-size / 1px + 4);
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
.biggest {
@include em($base-font-size / 1px + 6);
}
code,
pre,
samp,
kbd {
2014-05-19 10:46:39 +02:00
/* IE fix */
white-space: pre-line;
2014-05-04 15:48:00 +02:00
white-space: pre-wrap;
font-family: $font-stack-monospace;
line-height: normal;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
em,
.italic,
2014-05-04 15:48:00 +02:00
address,
cite,
dfn,
i,
var {
font-style: italic;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
strong,
.bold {
2014-05-04 15:48:00 +02:00
font-weight: bold;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
small,
sub,
sup {
font-size: smaller;
}
/* ----------------------------- */
/* == hiding content */
/* ----------------------------- */
2014-05-07 11:12:14 +02:00
/* hidden but not for assistance tools, Yahoo! method */
2014-05-04 15:48:00 +02:00
.visually-hidden {
2014-05-07 11:12:14 +02:00
position: absolute !important;
border: 0 !important;
height: 1px !important;
width: 1px !important;
padding: 0 !important;
overflow: hidden !important;
clip: rect(1px, 1px, 1px, 1px) !important;
2014-05-04 15:48:00 +02:00
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
body > script {
display: none !important;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
@media (max-width: $small-screen) {
.no-small-screen {
display: none;
}
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
@media (min-width: $large-screen) {
.no-large-screen {
display: none;
}
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
/* ----------------------------- */
/* == browsers consistency */
/* ----------------------------- */
/* avoid top margins on first content element */
2014-05-07 11:12:14 +02:00
p,
.p-like,
ul,
ol,
dl,
blockquote,
pre,
h1,
h2,
h3,
h4,
h5,
h6 {
2014-05-04 15:48:00 +02:00
&:first-child {
margin-top: 0;
}
}
/* avoid margins on nested elements */
li p,
li .p-like,
li ul,
li ol {
margin-top: 0;
margin-bottom: 0;
}
/* max values */
2014-05-07 11:12:14 +02:00
img,
table,
td,
blockquote,
code,
pre,
textarea,
input,
video {
2014-05-04 15:48:00 +02:00
max-width: 100%;
}
/* margin-bottom on tables */
2014-05-07 11:12:14 +02:00
table {
margin-bottom: $medium-value;
}
2014-05-04 15:48:00 +02:00
/* ----------------------------- */
/* ==layout and modules */
/* ----------------------------- */
/* float layout */
/* module, gains superpower "BFC" Block Formating Context */
.mod {
overflow: hidden;
}
/* blocks that needs to be placed under floats */
.clear,
.line,
.row {
clear: both;
}
/* blocks that must contain floats */
.clearfix,
.line {
&:after {
content: "";
display: table;
clear: both;
border-collapse: collapse;
2014-05-04 15:48:00 +02:00
}
}
/* table layout */
.row {
display: table;
table-layout: fixed;
width: 100%;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
.row > *,
.col {
display: table-cell;
vertical-align: top;
}
/* inline-block */
.inbl {
display: inline-block;
vertical-align: top;
}
/* alignments (blocks and inline) */
/* ------------------------------ */
/* left (or starting) elements */
.left,
.start {
float: left;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
img.left,
img.start {
margin-right: $small-value;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
/* right (or ending) elements */
.right,
.end {
float: right;
}
2014-05-07 11:12:14 +02:00
2014-05-04 15:48:00 +02:00
img.right,
img.end {
margin-left: $small-value;
}
2014-05-07 11:12:14 +02:00
img.left,
img.right,
img.start,
img.end {
2014-05-04 15:48:00 +02:00
margin-bottom: $tiny-value;
}
2014-05-07 11:12:14 +02:00
.center {
margin-left: auto;
margin-right: auto;
}
.txtleft {
text-align: left;
}
.txtright {
text-align: right;
}
.txtcenter {
text-align: center;
}
2014-05-04 15:48:00 +02:00
// width helpers boolean
@if $enable-helpers-width == true {
/* blocks widths (percentage and pixels) */
2014-05-07 11:12:14 +02:00
.w10 {
width: 10%;
}
.w20 {
width: 20%;
}
.w25 {
width: 25%;
}
.w30 {
width: 30%;
}
.w33 {
width: 33.3333%;
}
.w40 {
width: 40%;
}
.w50 {
width: 50%;
}
.w60 {
width: 60%;
}
.w66 {
width: 66.6666%;
}
.w70 {
width: 70%;
}
.w75 {
width: 75%;
}
.w80 {
width: 80%;
}
.w90 {
width: 90%;
}
.w100 {
width: 100%;
}
.w50p {
width: 50px;
}
.w100p {
width: 100px;
}
.w150p {
width: 150px;
}
.w200p {
width: 200px;
}
.w300p {
width: 300px;
}
.w400p {
width: 400px;
}
.w500p {
width: 500px;
}
.w600p {
width: 600px;
}
.w700p {
width: 700px;
}
.w800p {
width: 800px;
}
.w960p {
width: 960px;
}
.mw960p {
max-width: 960px;
}
.w1140p {
width: 1140px;
}
.mw1140p {
max-width: 1140px;
}
.wauto {
width: auto;
}
2014-05-04 15:48:00 +02:00
}
// spacing helpers boolean
@if $enable-helpers-spacing == true {
/* spacing helpers
p,m = padding,margin
a,t,r,b,l = all,top,right,bottom,left
s,m,l,n = small, medium, large, none
*/
2014-05-07 11:12:14 +02:00
.man {
margin: 0;
}
.pan {
padding: 0;
}
.mas {
margin: $small-value;
}
.mam {
margin: $medium-value;
}
.mal {
margin: $large-value;
}
.pas {
padding: $small-value;
}
.pam {
padding: $medium-value;
}
.pal {
padding: $large-value;
}
.mtn {
margin-top: 0;
}
.mts {
margin-top: $small-value;
}
.mtm {
margin-top: $medium-value;
}
.mtl {
margin-top: $large-value;
}
.mrn {
margin-right: 0;
}
.mrs {
margin-right: $small-value;
}
.mrm {
margin-right: $medium-value;
}
.mrl {
margin-right: $large-value;
}
.mbn {
margin-bottom: 0;
}
.mbs {
margin-bottom: $small-value;
}
.mbm {
margin-bottom: $medium-value;
}
.mbl {
margin-bottom: $large-value;
}
.mln {
margin-left: 0;
}
.mls {
margin-left: $small-value;
}
.mlm {
margin-left: $medium-value;
}
.mll {
margin-left: $large-value;
}
.ptn {
padding-top: 0;
}
.pts {
padding-top: $small-value;
}
.ptm {
padding-top: $medium-value;
}
.ptl {
padding-top: $large-value;
}
.prn {
padding-right: 0;
}
.prs {
padding-right: $small-value;
}
.prm {
padding-right: $medium-value;
}
.prl {
padding-right: $large-value;
}
.pbn {
padding-bottom: 0;
}
.pbs {
padding-bottom: $small-value;
}
.pbm {
padding-bottom: $medium-value;
}
.pbl {
padding-bottom: $large-value;
}
.pln {
padding-left: 0;
}
.pls {
padding-left: $small-value;
}
.plm {
padding-left: $medium-value;
}
.pll {
padding-left: $large-value;
}
2014-05-04 15:48:00 +02:00
}