From 0dea8b0c7473c1db4aea7accfd0a68cbf09b9576 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 28 Feb 2013 19:42:51 -0800 Subject: [PATCH] Fixes #6897: Print styles get own .less file --- docs/assets/css/bootstrap.css | 106 +++++++++++++++++----------------- docs/customize.html | 1 + less/bootstrap.less | 5 +- less/print.less | 69 ++++++++++++++++++++++ less/scaffolding.less | 70 ---------------------- 5 files changed, 126 insertions(+), 125 deletions(-) create mode 100644 less/print.less diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index e20f1a6647..159cc53270 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -1,7 +1,7 @@ /*! * Bootstrap v3.0.0 * - * Copyright 2012 Twitter, Inc + * Copyright 2013 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * @@ -218,6 +218,58 @@ table { border-spacing: 0; } +@media print { + * { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + @page { + margin: 0.5cm; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } +} + html { font-size: 62.5%; -webkit-overflow-scrolling: touch; @@ -283,58 +335,6 @@ img { border-radius: 500px; } -@media print { - * { - color: #000 !important; - text-shadow: none !important; - background: transparent !important; - box-shadow: none !important; - } - a, - a:visited { - text-decoration: underline; - } - a[href]:after { - content: " (" attr(href) ")"; - } - abbr[title]:after { - content: " (" attr(title) ")"; - } - .ir a:after, - a[href^="javascript:"]:after, - a[href^="#"]:after { - content: ""; - } - pre, - blockquote { - border: 1px solid #999; - page-break-inside: avoid; - } - thead { - display: table-header-group; - } - tr, - img { - page-break-inside: avoid; - } - img { - max-width: 100% !important; - } - @page { - margin: 0.5cm; - } - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - h2, - h3 { - page-break-after: avoid; - } -} - p { margin: 0 0 10px; } diff --git a/docs/customize.html b/docs/customize.html index 9a503ff8f4..014a48f5e4 100644 --- a/docs/customize.html +++ b/docs/customize.html @@ -44,6 +44,7 @@ title: Customize and download

Scaffolding

+ diff --git a/less/bootstrap.less b/less/bootstrap.less index 60d166368c..461f9eceac 100644 --- a/less/bootstrap.less +++ b/less/bootstrap.less @@ -1,7 +1,7 @@ /*! * Bootstrap v3.0.0 * - * Copyright 2012 Twitter, Inc + * Copyright 2013 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * @@ -9,11 +9,12 @@ */ // Core variables and mixins -@import "variables.less"; // Modify this for custom colors, font-sizes, etc +@import "variables.less"; @import "mixins.less"; // Reset @import "normalize.less"; +@import "print.less"; // Core CSS @import "scaffolding.less"; diff --git a/less/print.less b/less/print.less new file mode 100644 index 0000000000..c7e78e234d --- /dev/null +++ b/less/print.less @@ -0,0 +1,69 @@ +// +// Basic print styles +// -------------------------------------------------- +// Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css + +@media print { + + * { + text-shadow: none !important; + color: #000 !important; // Black prints faster: h5bp.com/s + background: transparent !important; + box-shadow: none !important; + } + + a, + a:visited { + text-decoration: underline; + } + + a[href]:after { + content: " (" attr(href) ")"; + } + + abbr[title]:after { + content: " (" attr(title) ")"; + } + + // Don't show links for images, or javascript/internal links + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + + thead { + display: table-header-group; // h5bp.com/t + } + + tr, + img { + page-break-inside: avoid; + } + + img { + max-width: 100% !important; + } + + @page { + margin: 0.5cm; + } + + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + + h2, + h3 { + page-break-after: avoid; + } +} diff --git a/less/scaffolding.less b/less/scaffolding.less index d885c765ed..eee9cc93c6 100644 --- a/less/scaffolding.less +++ b/less/scaffolding.less @@ -85,73 +85,3 @@ img { .img-circle { border-radius: 500px; // crank the border-radius so it works with most reasonably sized images } - - -// Printing -// ------------------------- -// Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css - -@media print { - - * { - text-shadow: none !important; - color: #000 !important; // Black prints faster: h5bp.com/s - background: transparent !important; - box-shadow: none !important; - } - - a, - a:visited { - text-decoration: underline; - } - - a[href]:after { - content: " (" attr(href) ")"; - } - - abbr[title]:after { - content: " (" attr(title) ")"; - } - - // Don't show links for images, or javascript/internal links - .ir a:after, - a[href^="javascript:"]:after, - a[href^="#"]:after { - content: ""; - } - - pre, - blockquote { - border: 1px solid #999; - page-break-inside: avoid; - } - - thead { - display: table-header-group; // h5bp.com/t - } - - tr, - img { - page-break-inside: avoid; - } - - img { - max-width: 100% !important; - } - - @page { - margin: 0.5cm; - } - - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - - h2, - h3 { - page-break-after: avoid; - } -}