From 5e6b31f84982a1ed97658de48a360ca293abc6e5 Mon Sep 17 00:00:00 2001 From: raphaelgoettter Date: Wed, 4 Mar 2015 14:43:27 +0100 Subject: [PATCH] Mise en commun des styles h1 et .h1-like (idem pour h2, h3, etc.) --- less/_01-base.less | 12 +++++++++--- less/_09-print.less | 14 +++++++++++++- sass/_01-base.scss | 12 +++++++++--- sass/_09-print.scss | 14 +++++++++++++- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/less/_01-base.less b/less/_01-base.less index e06c6a6..7835dc3 100644 --- a/less/_01-base.less +++ b/less/_01-base.less @@ -236,11 +236,17 @@ dl, blockquote, pre, h1, +.h1-like, h2, +.h2-like, h3, +.h3-like, h4, +.h4-like, h5, -h6 { +.h5-like, +h6, +.h6-like { &:first-child { margin-top: 0; } @@ -279,7 +285,7 @@ table { /* float layout */ /* module, gains superpower "BFC" Block Formating Context */ -.mod { +.mod { overflow: hidden; } @@ -330,7 +336,7 @@ table { } img.left, -img.start { +img.start { margin-right: @small-value; } diff --git a/less/_09-print.less b/less/_09-print.less index 31a3358..06b701d 100644 --- a/less/_09-print.less +++ b/less/_09-print.less @@ -17,12 +17,19 @@ } p, + .p-like, h1, + .h1-like, h2, + .h2-like, h3, + .h3-like, h4, + .h4-like, h5, + .h5-like, h6, + .h6-like, blockquote, ul, ol { @@ -44,6 +51,7 @@ /* no orphans, no widows */ p, + .p-like, blockquote { orphans: 3; widows: 3; @@ -57,14 +65,18 @@ } /* page break before main headers */ - h1 { + h1, + .h1-like { page-break-before: always; } /* no breaks after these elements */ h1, + .h1-like, h2, + .h2-like, h3, + .h3-like, caption { page-break-after: avoid; } diff --git a/sass/_01-base.scss b/sass/_01-base.scss index 9da0ae9..f741e91 100644 --- a/sass/_01-base.scss +++ b/sass/_01-base.scss @@ -229,11 +229,17 @@ dl, blockquote, pre, h1, +.h1-like, h2, +.h2-like, h3, +.h3-like, h4, +.h4-like, h5, -h6 { +.h5-like, +h6, +.h6-like { &:first-child { margin-top: 0; } @@ -262,7 +268,7 @@ video { } /* margin-bottom on tables */ -table { +table { margin-bottom: $medium-value; } @@ -324,7 +330,7 @@ table { } img.left, -img.start { +img.start { margin-right: $small-value; } diff --git a/sass/_09-print.scss b/sass/_09-print.scss index af3b0fd..2311ac7 100644 --- a/sass/_09-print.scss +++ b/sass/_09-print.scss @@ -16,12 +16,19 @@ } p, + .p-like, h1, + .h1-like, h2, + .h2-like, h3, + .h3-like, h4, + .h4-like, h5, + .h5-like, h6, + .h6-like, blockquote, ul, ol { @@ -43,6 +50,7 @@ /* no orphans, no widows */ p, + .p-like, blockquote { orphans: 3; widows: 3; @@ -56,14 +64,18 @@ } /* page break before main headers */ - h1 { + h1, + .h1-like { page-break-before: always; } /* no breaks after these elements */ h1, + .h1-like, h2, + .h2-like, h3, + .h3-like, caption { page-break-after: avoid; }