Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 54618bc

Browse files
committed
Improve styling and formatting
1 parent f6b5307 commit 54618bc

File tree

2 files changed

+42
-19
lines changed

2 files changed

+42
-19
lines changed

Sources/swift-doc/Supporting Types/CSS.swift

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ let css = #"""
166166
167167
:root {
168168
--large-title: 600 32pt / 39pt sans-serif;
169-
--title-1: 500 26pt / 32pt sans-serif;
170-
--title-2: 500 20pt / 25pt sans-serif;
169+
--title-1: 600 26pt / 32pt sans-serif;
170+
--title-2: 600 20pt / 25pt sans-serif;
171171
--title-3: 500 18pt / 23pt sans-serif;
172172
--headline: 500 15pt / 20pt sans-serif;
173173
--body: 300 15pt / 20pt sans-serif;
@@ -353,12 +353,12 @@ dfn {
353353
font-style: italic;
354354
}
355355
356-
sup {
356+
/* sup {
357357
font-size: 0.6em;
358358
vertical-align: top;
359359
position: relative;
360360
bottom: -0.2em;
361-
}
361+
} */
362362
363363
:matches(h1, h2, h3) sup {
364364
font-size: 0.4em;
@@ -773,13 +773,6 @@ body {
773773
width: 90vw;
774774
max-width: 1280px;
775775
margin: 1em auto;
776-
/* display: grid;
777-
grid-template-areas:
778-
"header search"
779-
"main nav"
780-
"footer footer";
781-
grid-template-columns: 4fr 2fr;
782-
gap: 1em; */
783776
}
784777
785778
body > header {
@@ -790,15 +783,28 @@ body > header a {
790783
color: var(--label);
791784
}
792785
786+
body > header span {
787+
font-weight: normal;
788+
}
789+
790+
body > header sup {
791+
text-transform: uppercase;
792+
font-size: small;
793+
font-weight: 300;
794+
color: var(--secondary-label);
795+
letter-spacing: 0.1ch;
796+
}
797+
793798
@media screen and (max-width: 768px) {
794799
body {
795800
width: 96vw;
796801
max-width: 100%;
797802
}
798803
799804
body > header {
800-
font: var(--title-1);
801-
text-align: center;
805+
font: var(--title-3);
806+
text-align: left;
807+
padding: 1em 0;
802808
}
803809
804810
body > nav {
@@ -808,10 +814,21 @@ body > header a {
808814
body > main {
809815
padding: 0 1em;
810816
}
817+
818+
#relationships figure {
819+
display: none;
820+
}
821+
822+
section > [role="article"][class] pre {
823+
margin-left: -2.5em;
824+
}
825+
826+
section > [role="article"][class] div {
827+
margin-left: -2em;
828+
}
811829
}
812830
813831
body > header {
814-
grid-area: header;
815832
padding: 0.5em 0;
816833
}
817834
@@ -950,7 +967,7 @@ article > .summary:last-child {
950967
}
951968
952969
dl {
953-
padding-bottom: 1em;
970+
padding-top: 1em;
954971
}
955972
956973
dt {
@@ -1068,13 +1085,15 @@ dl dt[class] {
10681085
10691086
section > [role="article"] {
10701087
margin-bottom: 1em;
1088+
padding-bottom: 1em;
10711089
border-bottom: 1px var(--separator) solid;
10721090
padding-left: 2em !important;
10731091
}
10741092
10751093
section > [role="article"]:last-of-type {
1076-
border-bottom: none;
10771094
margin-bottom: 0;
1095+
padding-bottom: 0;
1096+
border-bottom: none;
10781097
}
10791098
10801099
nav li[class],

Sources/swift-doc/Supporting Types/Layout.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ func layout(_ page: Page) -> HTML {
1717
</head>
1818
<body>
1919
<header>
20-
<strong>
21-
<a href="/">\#(page.module.name)</a>
22-
</strong>
20+
<a href="/">
21+
<strong>
22+
\#(page.module.name)
23+
</strong>
24+
<span>Documentation</span>
25+
</a>
26+
<sup>Beta</sup>
2327
</header>
2428
2529
<!--

0 commit comments

Comments
 (0)