252 lines
7.9 KiB
Text
252 lines
7.9 KiB
Text
/*!
|
|
* www.KNACSS.com V4.4.3 (14 janvier 2016) @author: Raphael Goetter, Alsacreations
|
|
* Licence WTFPL http://www.wtfpl.net/
|
|
*/
|
|
|
|
// Config file and project variables
|
|
|
|
// font sizes
|
|
@base-font-size : 1.4rem; // ex. 1.4rem would be "14px" equivalent
|
|
@line-height : 1.5; // equiv line-height 1.5
|
|
@h1-size : 3.2rem; // equiv "32px"
|
|
@h2-size : 2.8rem; // equiv "28px"
|
|
@h3-size : 2.4rem; // equiv "24px"
|
|
@h4-size : 2.0rem; // equiv "20px"
|
|
@h5-size : 1.8rem; // equiv "18px"
|
|
@h6-size : 1.6rem; // equiv "16px"
|
|
|
|
// font stacks
|
|
@font-stack-common : sans-serif; // common font
|
|
@font-stack-headings : sans-serif; // headings font
|
|
@font-stack-monospace : consolas, courier, monospace; // monospace font
|
|
|
|
// font colors
|
|
@base-color : #000; // text color on body and content
|
|
@primary-color : #000; // text color on primary elements
|
|
@secondary-color : #000; // text color on secondary elements
|
|
@headings-color : #000; // text color on headings
|
|
@headings-1-color : #000; // text color on headings level 1
|
|
@headings-2-color : #000; // text color on headings level 2
|
|
@headings-3-color : #000; // text color on headings level 3
|
|
@base-color-link : #333; // base links color
|
|
@base-color-link-hover : #000; // base hovered/focused links color
|
|
|
|
// backgrounds
|
|
@base-background : #fff; // body background color
|
|
@primary-background : #fff; // primary elements background color
|
|
@secondary-background : #fff; // secondary elements background color
|
|
|
|
// spacings (choose unit you prefer)
|
|
@tiny-value : .5rem; // tiny value for margins / paddings
|
|
@tiny-plus-value : .7rem; // tiny+ value for margins / paddings
|
|
@small-value : 1rem; // small value for margins / paddings
|
|
@small-plus-value : 1.5rem; // small+ value for margins / paddings
|
|
@medium-value : 2rem; // medium value for margins / paddings
|
|
@medium-plus-value : 3rem; // medium+ value for margins / paddings
|
|
@large-value : 4rem; // large value for margins / paddings
|
|
@large-plus-value : 6rem; // large value for margins / paddings
|
|
@extra-large-value : 8rem; // extra large value for margins / paddings
|
|
@extra-large-plus-value : 12rem; // extra large value for margins / paddings
|
|
@ultra-large-value : 16rem; // ultra large value for margins / paddings
|
|
@ultra-large-plus-value : 20rem; // ultra large value for margins / paddings
|
|
|
|
// breakpoints (choose unit you prefer)
|
|
@tiny-screen : 320px; // tiny screens media query (less-equal than 320px)
|
|
@tiny-plus-screen : 480px; // screens between 321px and 480px
|
|
@small-screen : 640px; // screens between 481px and 640px
|
|
@small-plus-screen : 768px; // screens between 641px and 768px
|
|
@medium-screen : 960px; // screens between 769px and 960px
|
|
@medium-plus-screen : 1024px; // screens between 961px and 1024px
|
|
@large-screen : 1280px; // screens between 1025px and 1280px
|
|
@large-plus-screen : 1440px; // screens between 1281px and 1440px
|
|
@extra-large-screen : 1600px; // screens between 1441px and 1600px
|
|
@ultra-large-screen : 1920px; // ultra large screens
|
|
|
|
// grids variables (choose unit you prefer)
|
|
@gutter: 2rem; // gutter value for grid layouts. Unit can be: %, px, em, rem
|
|
@number: 4; // number of equal columns
|
|
@left: 2; // left side of uneven columns
|
|
@right: 1; // right side of uneven columns
|
|
|
|
//namespace (default : empty)
|
|
@kna-namespace:~"";
|
|
|
|
/* ---------------------------------- */
|
|
/* ==Grillade */
|
|
/* ---------------------------------- */
|
|
|
|
// Tuto : http://www.alsacreations.com/tuto/lire/1659-une-grille-responsive-avec-flexbox-et-LESS.html
|
|
// Demo : http://codepen.io/raphaelgoetter/pen/zxBMLW
|
|
|
|
// Usage in vanilla CSS:
|
|
// - <div class="grid-4"> for an equal fourth columns grid container
|
|
// - <div class="grid-2-1"> for an uneven columns grid container
|
|
|
|
// Usage with preprocessors : if you're using LESS, you can config grids variables :
|
|
// n = number of columns (default = 4)
|
|
// example : .grid-perso { .grid(12); }
|
|
// ... or uneven grids :
|
|
// left = left ratio column (default = 2) / right = right ratio column (default = 1)
|
|
// example : .grid-perso { .uneven-grid(2, 1); }
|
|
|
|
/* grid container */
|
|
[class*="@{kna-namespace}grid-"] {
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-wrap: wrap;
|
|
margin-left: -@gutter;
|
|
|
|
/* inline-block fallback for IE9 generation */
|
|
letter-spacing: -0.31em;
|
|
}
|
|
|
|
/* grid childs */
|
|
[class*="@{kna-namespace}grid-"] > * {
|
|
box-sizing: border-box;
|
|
flex: 0 0 auto;
|
|
width: ~'calc(100% * 1 / @{number} - @{gutter} - .01px)';
|
|
min-width: 0;
|
|
margin-left: @gutter;
|
|
|
|
/* inline-block fallback for IE9 generation */
|
|
display: inline-block;
|
|
vertical-align: top;
|
|
letter-spacing: normal;
|
|
}
|
|
|
|
// LESS mixins for *equal* columns grid container
|
|
// example : .grid-perso { .grid(12); }
|
|
.grid(@number:@number, @gutter:@gutter) {
|
|
& > * {
|
|
width: ~'calc(100% * 1 / @{number} - @{gutter} - .01px)';
|
|
}
|
|
& > .@{kna-namespace}flex-item-double {
|
|
width: ~'calc(100% * 2 / @{number} - @{gutter} - .01px)';
|
|
}
|
|
}
|
|
|
|
// Examples : will be compiled in CSS
|
|
[class*="@{kna-namespace}grid-2"] {
|
|
.grid(2);
|
|
}
|
|
[class*="@{kna-namespace}grid-3"] {
|
|
.grid(3);
|
|
}
|
|
[class*="@{kna-namespace}grid-4"] {
|
|
.grid(4);
|
|
}
|
|
[class*="@{kna-namespace}grid-5"] {
|
|
.grid(5);
|
|
}
|
|
[class*="@{kna-namespace}grid-6"] {
|
|
.grid(6);
|
|
}
|
|
[class*="@{kna-namespace}grid-7"] {
|
|
.grid(7);
|
|
}
|
|
[class*="@{kna-namespace}grid-8"] {
|
|
.grid(8);
|
|
}
|
|
[class*="@{kna-namespace}grid-10"] {
|
|
.grid(10);
|
|
}
|
|
[class*="@{kna-namespace}grid-12"] {
|
|
.grid(12);
|
|
}
|
|
|
|
/* Responsive grid */
|
|
// "small-2" = 2 columns when small screen
|
|
// example : .grid-4-small-2 will be 4 then 2 columns
|
|
@media (max-width: @small-screen) {
|
|
[class*="-small-4"] > * {
|
|
width: ~'calc(100% * 1 / 4 - @{gutter} - .01px)';
|
|
}
|
|
[class*="-small-4"] > .flex-item-double {
|
|
width: ~'calc(100% * 1 / 2 - @{gutter} - .01px)';
|
|
}
|
|
[class*="-small-3"] > * {
|
|
width: ~'calc(100% * 1 / 3 - @{gutter} - .01px)';
|
|
}
|
|
[class*="-small-3"] > .flex-item-double {
|
|
width: ~'calc(100% * 2 / 3 - @{gutter} - .01px)';
|
|
}
|
|
[class*="-small-2"] > * {
|
|
width: ~'calc(100% * 1 / 2 - @{gutter} - .01px)';
|
|
}
|
|
[class*="-small-2"] > .flex-item-double {
|
|
width: ~'calc(100% - @{gutter} - .01px)';
|
|
}
|
|
[class*="-small-1"] > * {
|
|
width: ~'calc(100% - @{gutter} - .01px)';
|
|
}
|
|
[class*="-small-1"] > .flex-item-double {
|
|
width: ~'calc(100% - @{gutter} - .01px)';
|
|
}
|
|
}
|
|
// "tiny-1" = 1 column when tiny screen
|
|
// example : .grid-4-small-2-tiny-1 will be 4 then 2 columns then 1 column
|
|
@media (max-width: @tiny-screen) {
|
|
[class*="-tiny-2"] > * {
|
|
width: ~'calc(100% * 1 / 2 - @{gutter} - .01px)';
|
|
}
|
|
[class*="-tiny-2"] > .flex-item-double {
|
|
width: ~'calc(100% - @{gutter} - .01px)';
|
|
}
|
|
[class*="-tiny-1"] > * {
|
|
width: ~'calc(100% - @{gutter} - .01px)';
|
|
}
|
|
[class*="-tiny-1"] > .flex-item-double {
|
|
width: ~'calc(100% - @{gutter} - .01px)';
|
|
}
|
|
}
|
|
|
|
// LESS mixins for *unequal* columns grid container
|
|
// example : .grid-perso { .uneven-grid(2, 1); }
|
|
.uneven-grid(@left:@left, @right:@right, @gutter:@gutter) {
|
|
& > *:nth-child(odd) {
|
|
@size: (@left / (@left + @right)) * 100%;
|
|
width: ~'calc(@{size} - @{gutter} - .01px)';
|
|
}
|
|
& > *:nth-child(even) {
|
|
@size: (@right / (@left + @right)) * 100%;
|
|
width: ~'calc(@{size} - @{gutter} - .01px)';
|
|
}
|
|
@media (max-width: @small-screen) {
|
|
& > *:nth-child(n) {
|
|
width: ~'calc(100% - @{gutter} - .01px)';
|
|
}
|
|
}
|
|
}
|
|
|
|
// Examples : will be compiled in CSS
|
|
.@{kna-namespace}grid-2-1 {
|
|
.uneven-grid(2,1);
|
|
}
|
|
.@{kna-namespace}grid-1-2 {
|
|
.uneven-grid(1,2);
|
|
}
|
|
.@{kna-namespace}grid-3-1 {
|
|
.uneven-grid(3,1);
|
|
}
|
|
.@{kna-namespace}grid-1-3 {
|
|
.uneven-grid(1,3);
|
|
}
|
|
.@{kna-namespace}grid-3-2 {
|
|
.uneven-grid(3,2);
|
|
}
|
|
.@{kna-namespace}grid-2-3 {
|
|
.uneven-grid(2,3);
|
|
}
|
|
.@{kna-namespace}grid-4-1 {
|
|
.uneven-grid(4,1);
|
|
}
|
|
.@{kna-namespace}grid-1-4 {
|
|
.uneven-grid(1,4);
|
|
}
|
|
|
|
.@{kna-namespace}pull {
|
|
margin-right: auto;
|
|
}
|
|
.@{kna-namespace}push {
|
|
margin-left: auto;
|
|
}
|