Skip to content

Instantly share code, notes, and snippets.

@paulvanbuuren
Last active August 29, 2015 14:12
Show Gist options
  • Save paulvanbuuren/9313e330895f3f4ab862 to your computer and use it in GitHub Desktop.
Save paulvanbuuren/9313e330895f3f4ab862 to your computer and use it in GitHub Desktop.
Header level. LESS mixin to help you identify the level of the headers in your text.
/* ======================================================
LESS mixin to help you identify the level
of the headers in your text.
---------------
Using a sound and complete header hierarchy vastly
improves the accessibility and understandability of your
document.
====================================================== */
@violet: #C42C76;
@wit: #fff;
@bodyfont: Helvetica, Arial, sans-serif;
.headercheck() {
h1, h2, h3, h4, h5, h6 {
&:before {
content: 'header';
background: @violet;
color: @wit;
padding: .5em;
font-size: 16px;
display: block;
font-family: @bodyfont;
float: left;
margin: 0 .3em .3em 0;
border: 1px solid @wit;
}
}
h1 {
&:before {
background: darken(@violet,1%);
content: 'H1';
}
}
h2 {
&:before {
background: darken(@violet,10%);
content: 'H2';
}
}
h3 {
&:before {
background: darken(@violet,20%);
content: 'H3';
}
}
h4 {
&:before {
background: darken(@violet,30%);
content: 'H4';
}
}
h5 {
&:before {
background: darken(@violet,40%);
content: 'H5';
}
}
h6 {
&:before {
background: darken(@violet,50%);
content: 'H6';
}
}
}
.headercheck();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment