From d371037f4a68983a5924f62a6f29f891f6a35dbb Mon Sep 17 00:00:00 2001 From: mrmrs Date: Fri, 4 Dec 2015 12:35:18 +0800 Subject: [PATCH 1/4] Add consistent formatting in swift.css This changes all classes to be formatted in the same way. * Each property is on it's own line * Each declaration is on it's own line * Single linebreak in between rulesets --- www/_static/swift.css | 91 +++++++++++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 25 deletions(-) diff --git a/www/_static/swift.css b/www/_static/swift.css index 826b89b23a536..5ed46ebc66c38 100644 --- a/www/_static/swift.css +++ b/www/_static/swift.css @@ -1,27 +1,58 @@ /* Common styles */ -.body { color: black; background: white; margin: 0 0 0 0 } +.body { + color: black; + background: white; + margin: 0 0 0 0; +} /* No borders on image links */ -a:link img, a:visited img { border-style: none } +a:link img, +a:visited img { + border-style: none; +} -address img { float: right; width: 88px; height: 31px; } -address { clear: right; } +address img { + float: right; + width: 88px; + height: 31px; +} +address { + clear: right; +} + +table { + border: 2px solid black; + border-collapse: collapse; + margin-top: 1em; + margin-left: 1em; + margin-right: 1em; + margin-bottom: 1em; +} + +tr, +td { + border: 2px solid gray; + padding: 4pt 4pt 2pt 2pt; +} -table { border: 2px solid black; - border-collapse: collapse; margin-top: 1em; margin-left: 1em; - margin-right: 1em; margin-bottom: 1em; } -tr, td { border: 2px solid gray; padding: 4pt 4pt 2pt 2pt; } -th { border: 2px solid gray; font-weight: bold; font-size: 105%; +th { + border: 2px solid gray; + font-weight: bold; + font-size: 105%; background: url("http://llvm.org/img/lines.gif"); font-family: "Georgia,Palatino,Times,Roman,SanSerif"; - text-align: center; vertical-align: middle; } - + text-align: center; + vertical-align: middle; +} /* Common for title and header */ -h1, h2 { - color: black; background: url("http://llvm.org/img/lines.gif"); - font-family: "Georgia,Palatino,Times,Roman,SanSerif"; font-weight: bold; +h1, +h2 { + color: black; + background: url("http://llvm.org/img/lines.gif"); + font-family: "Georgia,Palatino,Times,Roman,SanSerif"; + font-weight: bold; border-width: 1px; border-style: solid none solid none; text-align: center; @@ -33,32 +64,42 @@ h1, h2 { h1 { - text-align: center; font-size: 22pt; - margin: 20pt 0pt 0pt 0pt; + text-align: center; + font-size: 22pt; + margin: 20pt 0pt 0pt 0pt; } -.doc_title, .title { text-align: left; font-size: 25pt } +.doc_title, +.title { + text-align: left; + font-size: 25pt; +} -h2, .doc_subsection { width: 100%; - text-align: left; font-size: 12pt; +h2, +.doc_subsection { + width: 100%; + text-align: left; + font-size: 12pt; padding: 4pt 4pt 4pt 4pt; margin: 1.5em 5em 0.5em 0em } h3 { margin: 2.0em 0.5em 0.5em 0em; - font-weight: bold; font-style: oblique; - border-bottom: 1px solid #999999; font-size: 12pt; + font-weight: bold; + font-style: oblique; + border-bottom: 1px solid #999999; + font-size: 12pt; width: 75%; clear:both; } body p { - margin: 1em 0pt 0pt 15pt; + margin: 1em 0pt 0pt 15pt; } - -pre.grammar, pre.stdlib { +pre.grammar, +pre.stdlib { background: #FFFFE0; padding: 1em 0 0 0; } @@ -73,5 +114,5 @@ pre.example { width: 33%; background: #C0C0FF; padding: 1em 1em 1em 1em; - margin: 0em 0em 0em 1em; + margin: 0em 0em 0em 1em; } From bababd69c167caa628eeeb6ef63e017fd765f9d8 Mon Sep 17 00:00:00 2001 From: mrmrs Date: Fri, 4 Dec 2015 12:37:19 +0800 Subject: [PATCH 2/4] Change formatting of background image declarations * Remove quotes from url function * Change background to background-image where only image is defined --- www/_static/swift.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/_static/swift.css b/www/_static/swift.css index 5ed46ebc66c38..b8175a31ae14b 100644 --- a/www/_static/swift.css +++ b/www/_static/swift.css @@ -40,7 +40,7 @@ th { border: 2px solid gray; font-weight: bold; font-size: 105%; - background: url("http://llvm.org/img/lines.gif"); + background-image: url(http://llvm.org/img/lines.gif); font-family: "Georgia,Palatino,Times,Roman,SanSerif"; text-align: center; vertical-align: middle; @@ -50,7 +50,7 @@ th { h1, h2 { color: black; - background: url("http://llvm.org/img/lines.gif"); + background-image: url(http://llvm.org/img/lines.gif); font-family: "Georgia,Palatino,Times,Roman,SanSerif"; font-weight: bold; border-width: 1px; From b6299ad2d3eb8d0cfbd56ee55c90d5d44acc4b4a Mon Sep 17 00:00:00 2001 From: mrmrs Date: Fri, 4 Dec 2015 12:41:25 +0800 Subject: [PATCH 3/4] Remove quotes from font-family string. Quotes in font-family value are not supposed to wrap around multiple typeface names. They are only to wrap around single typeface names. --- www/_static/swift.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/_static/swift.css b/www/_static/swift.css index b8175a31ae14b..8c139b34d67d4 100644 --- a/www/_static/swift.css +++ b/www/_static/swift.css @@ -41,7 +41,7 @@ th { font-weight: bold; font-size: 105%; background-image: url(http://llvm.org/img/lines.gif); - font-family: "Georgia,Palatino,Times,Roman,SanSerif"; + font-family: Georgia,Palatino,Times,Roman,sans-serif; text-align: center; vertical-align: middle; } @@ -51,7 +51,7 @@ h1, h2 { color: black; background-image: url(http://llvm.org/img/lines.gif); - font-family: "Georgia,Palatino,Times,Roman,SanSerif"; + font-family: Georgia,Palatino,Times,Roman,sans-serif; font-weight: bold; border-width: 1px; border-style: solid none solid none; From 59528cf2512707201055001afc9b57932def2b0b Mon Sep 17 00:00:00 2001 From: mrmrs Date: Fri, 4 Dec 2015 12:46:19 +0800 Subject: [PATCH 4/4] Remove some unnecessary code. * Remove trailing and leading 0's from values with a decimal * Remove commented out css * Remove units from values of 0 --- www/_static/swift.css | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/www/_static/swift.css b/www/_static/swift.css index 8c139b34d67d4..cb8796a8bb17d 100644 --- a/www/_static/swift.css +++ b/www/_static/swift.css @@ -57,7 +57,6 @@ h2 { border-style: solid none solid none; text-align: center; vertical-align: middle; -/* padding-left: 0pt;*/ padding-top: 1px; padding-bottom: 2px } @@ -66,7 +65,7 @@ h2 { h1 { text-align: center; font-size: 22pt; - margin: 20pt 0pt 0pt 0pt; + margin: 20pt 0 0 0; } .doc_title, @@ -85,7 +84,7 @@ h2, } h3 { - margin: 2.0em 0.5em 0.5em 0em; + margin: 2em .5em .5em 0; font-weight: bold; font-style: oblique; border-bottom: 1px solid #999999; @@ -95,7 +94,7 @@ h3 { } body p { - margin: 1em 0pt 0pt 15pt; + margin: 1em 0 0 15pt; } pre.grammar, @@ -114,5 +113,5 @@ pre.example { width: 33%; background: #C0C0FF; padding: 1em 1em 1em 1em; - margin: 0em 0em 0em 1em; + margin: 0 0 0 1em; }