diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2021-08-02 16:10:57 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-02 16:10:57 -0600 |
| commit | 7fda8916eb2ae6a936cf1fd1291b135799fe2b52 (patch) | |
| tree | 5a40174a657ed8ee12c4d4a28dddb257c85870c7 | |
| parent | 449e0bcc1ef79340d9dd688a96e548efab54477b (diff) | |
resolves #4118 use autoprefixer to manage browser prefixes in default stylesheet (PR #4120)
| -rw-r--r-- | CHANGELOG.adoc | 1 | ||||
| -rw-r--r-- | data/stylesheets/asciidoctor-default.css | 32 | ||||
| -rw-r--r-- | src/stylesheets/asciidoctor.css | 23 | ||||
| -rw-r--r-- | src/stylesheets/package.json | 6 | ||||
| -rw-r--r-- | src/stylesheets/postcss.config.js | 1 |
5 files changed, 23 insertions, 40 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 40160748..ec506fd8 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -49,6 +49,7 @@ Improvements:: Infrastructure:: * Import source of default stylesheet into this repository; use PostCSS with cssnano to minify (#4062) + * Use autoprefixer to manage browser prefixes in default stylesheet (#4118) // tag::compact[] == 2.0.15 (2021-04-27) - @mojavelinux diff --git a/data/stylesheets/asciidoctor-default.css b/data/stylesheets/asciidoctor-default.css index 19ea1b25..a87969d8 100644 --- a/data/stylesheets/asciidoctor-default.css +++ b/data/stylesheets/asciidoctor-default.css @@ -1,7 +1,7 @@ /*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */ /* Uncomment the following line when using as a custom stylesheet */ /* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */ -html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%} +html{font-family:sans-serif;-webkit-text-size-adjust:100%} a{background:none} a:focus{outline:thin dotted} a:active,a:hover{outline:0} @@ -35,9 +35,9 @@ input[type=checkbox],input[type=radio]{padding:0} button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} textarea{overflow:auto;vertical-align:top} table{border-collapse:collapse;border-spacing:0} -*,::before,::after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box} +*,::before,::after{box-sizing:border-box} html,body{font-size:100%} -body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased} +body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased} a:hover{cursor:pointer} img,object,embed{max-width:100%;height:auto} object,embed{height:100%} @@ -103,7 +103,7 @@ h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title str :not(pre).nobreak{word-wrap:normal} :not(pre).nowrap{white-space:nowrap} :not(pre).pre-wrap{white-space:pre-wrap} -:not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed} +:not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed} pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed} pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit} pre>code{display:block} @@ -111,7 +111,7 @@ pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal} em em{font-style:normal} strong strong{font-weight:400} .keyseq{color:rgba(51,51,51,.8)} -kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap} +kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap} .keyseq kbd:first-child{margin-left:0} .keyseq kbd:last-child{margin-right:0} .menuseq,.menuref{color:#000} @@ -131,7 +131,7 @@ p a>code:hover{color:rgba(0,0,0,.9)} #header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0} #header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf} #header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px} -#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap} +#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap} #header .details span:first-child{margin-left:-.125em} #header .details span.email a{color:rgba(0,0,0,.85)} #header .details br{display:none} @@ -165,7 +165,7 @@ body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9 #toc.toc2>ul{font-size:.95em} #toc.toc2 ul ul{padding-left:1.25em} body.toc2.toc-right{padding-left:0;padding-right:20em}} -#content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px} +#content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px} #content #toc>:first-child{margin-top:0} #content #toc>:last-child{margin-bottom:0} #footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em} @@ -196,15 +196,15 @@ table.tableblock.fit-content>caption.title{white-space:nowrap;width:0} .admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase} .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere} .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0} -.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px} +.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px} .exampleblock>.content>:first-child{margin-top:0} .exampleblock>.content>:last-child{margin-bottom:0} -.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;-webkit-border-radius:4px;border-radius:4px} +.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px} .sidebarblock>:first-child{margin-top:0} .sidebarblock>:last-child{margin-bottom:0} .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center} .exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0} -.literalblock pre,.listingblock>.content>pre{-webkit-border-radius:4px;border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em} +.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em} @media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}} @media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}} .literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8} @@ -215,7 +215,7 @@ table.tableblock.fit-content>caption.title{white-space:nowrap;width:0} .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5} .listingblock.terminal pre .command:not([data-prompt])::before{content:"$"} .listingblock pre.highlightjs{padding:0} -.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px} +.listingblock pre.highlightjs>code{padding:1em;border-radius:4px} .listingblock pre.prettyprint{border-width:0} .prettyprint{background:#f7f7f8} pre.prettyprint .linenums{line-height:1.45;margin-left:2em} @@ -287,7 +287,7 @@ ul.unstyled,ol.unstyled{margin-left:0} ul.checklist>li>p:first-child{margin-left:-1em} ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em} ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em} -ul.inline{display:-ms-flexbox;display:-webkit-box;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em} +ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em} ul.inline>li{margin-left:1.25em} .unstyled dl dt{font-weight:400;font-style:normal} ol.arabic{list-style-type:decimal} @@ -306,7 +306,7 @@ td.hdlist2{word-wrap:anywhere} .colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top} .colist td:not([class]):first-child img{max-width:none} .colist td:not([class]):last-child{padding:.25em 0} -.thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd} +.thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd} .imageblock.left{margin:.25em .625em 1.25em 0} .imageblock.right{margin:.25em 0 1.25em .625em} .imageblock>.title{margin-bottom:0} @@ -374,7 +374,7 @@ a span.icon>.fa{cursor:inherit} .admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900} .admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400} .admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000} -.conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);-webkit-border-radius:50%;border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} +.conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} .conum[data-value]+b{display:none} .conum[data-value]::after{content:attr(data-value)} @@ -387,10 +387,10 @@ p strong,td.content strong,div.footnote strong{letter-spacing:-.005em} p,blockquote,dt,td.content,span.alt,summary{font-size:1.0625rem} p{margin-bottom:1.25rem} .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em} -.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc} +.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc} .print-only{display:none!important} @page{margin:1.25cm .75cm} -@media print{*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important} +@media print{*{box-shadow:none!important;text-shadow:none!important} html{font-size:80%} a{color:inherit!important;text-decoration:underline!important} a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important} diff --git a/src/stylesheets/asciidoctor.css b/src/stylesheets/asciidoctor.css index 7a8f473f..ef70ee2e 100644 --- a/src/stylesheets/asciidoctor.css +++ b/src/stylesheets/asciidoctor.css @@ -3,7 +3,6 @@ /* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */ html { font-family: sans-serif; - -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } @@ -178,8 +177,6 @@ table { *, ::before, ::after { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; box-sizing: border-box; } @@ -631,7 +628,6 @@ h6 strong { padding: 0.1em 0.5ex; word-spacing: -0.15em; background: #f7f7f8; - -webkit-border-radius: 4px; border-radius: 4px; line-height: 1.45; text-rendering: optimizeSpeed; @@ -681,9 +677,7 @@ kbd { line-height: 1.45; background: #f7f7f7; border: 1px solid #ccc; - -webkit-border-radius: 3px; border-radius: 3px; - -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 0.1em #fff inset; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 0.1em #fff inset; margin: 0 0.15em; padding: 0.2em 0.5em; @@ -811,11 +805,7 @@ body.toc2 #header > h1:nth-last-child(2) { padding-bottom: 0.25em; padding-left: 0.25em; color: rgba(0, 0, 0, 0.6); - display: -ms-flexbox; - display: -webkit-flex; display: flex; - -ms-flex-flow: row wrap; - -webkit-flex-flow: row wrap; flex-flow: row wrap; } @@ -995,7 +985,6 @@ body.toc2 #header > h1:nth-last-child(2) { margin-bottom: 1.25em; padding: 1.25em; background: #f8f8f7; - -webkit-border-radius: 4px; border-radius: 4px; } @@ -1245,7 +1234,6 @@ table.tableblock.fit-content > caption.title { margin-bottom: 1.25em; padding: 1.25em; background: #fff; - -webkit-border-radius: 4px; border-radius: 4px; } @@ -1262,7 +1250,6 @@ table.tableblock.fit-content > caption.title { margin-bottom: 1.25em; padding: 1.25em; background: #f3f3f2; - -webkit-border-radius: 4px; border-radius: 4px; } @@ -1293,7 +1280,6 @@ table.tableblock.fit-content > caption.title { .literalblock pre, .listingblock > .content > pre { - -webkit-border-radius: 4px; border-radius: 4px; overflow-x: auto; padding: 1em; @@ -1364,7 +1350,6 @@ table.tableblock.fit-content > caption.title { .listingblock pre.highlightjs > code { padding: 1em; - -webkit-border-radius: 4px; border-radius: 4px; } @@ -1767,11 +1752,7 @@ ul.checklist > li > p:first-child > input[type=checkbox]:first-child { } ul.inline { - display: -ms-flexbox; - display: -webkit-box; display: flex; - -ms-flex-flow: row wrap; - -webkit-flex-flow: row wrap; flex-flow: row wrap; list-style: none; margin: 0 0 0.625em -1.25em; @@ -1864,7 +1845,6 @@ td.hdlist2 { line-height: 0; display: inline-block; border: 4px solid #fff; - -webkit-box-shadow: 0 0 0 1px #ddd; box-shadow: 0 0 0 1px #ddd; } @@ -2176,7 +2156,6 @@ a span.icon > .fa { display: inline-block; color: #fff !important; background: rgba(0, 0, 0, 0.8); - -webkit-border-radius: 50%; border-radius: 50%; text-align: center; font-size: 0.75em; @@ -2258,7 +2237,6 @@ p.tableblock { .exampleblock > .content { background: #fffef7; border-color: #e0e0dc; - -webkit-box-shadow: 0 1px 4px #e0e0dc; box-shadow: 0 1px 4px #e0e0dc; } @@ -2272,7 +2250,6 @@ p.tableblock { @media print { * { - -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; } diff --git a/src/stylesheets/package.json b/src/stylesheets/package.json index 8f449914..79bc44c9 100644 --- a/src/stylesheets/package.json +++ b/src/stylesheets/package.json @@ -2,6 +2,7 @@ "private": true, "description": "Compiles the default stylesheet for the built-in HTML converter.", "devDependencies": { + "autoprefixer": "~10.3", "cssnano": "~5.0", "package.json": "^2.0.1", "postcss": "~8.3", @@ -12,5 +13,8 @@ "scripts": { "build": "postcss asciidoctor.css -o ../../data/stylesheets/asciidoctor-default.css", "lint": "stylelint asciidoctor.css" - } + }, + "browserslist": [ + "defaults" + ] } diff --git a/src/stylesheets/postcss.config.js b/src/stylesheets/postcss.config.js index 15e2b612..a379527d 100644 --- a/src/stylesheets/postcss.config.js +++ b/src/stylesheets/postcss.config.js @@ -1,5 +1,6 @@ module.exports = (ctx) => ({ plugins: { + autoprefixer: true, cssnano: { // refer to https://cssnano.co/docs/optimisations to understand this preset preset: [ |
