Skip to content

Commit 01c3acf

Browse files
committed
Style docs.
1 parent 7822d58 commit 01c3acf

File tree

6 files changed

+76
-18
lines changed

6 files changed

+76
-18
lines changed

public/styles.css

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import url("https://fonts.googleapis.com/css2?family=Calistoga&family=IBM+Plex+Mono&family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap");
1+
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Lora:ital,wght@0,400;0,700;1,400&display=swap");
22
html {
33
font-size: 62.5%/1.7em;
44
}
@@ -10,28 +10,65 @@ body {
1010
background: #fff;
1111
}
1212

13+
body > header {
14+
background-color: #1a1d1e;
15+
padding: 1rem;
16+
color: #fff;
17+
display: flex;
18+
justify-content: space-between;
19+
}
20+
21+
body > header a,
22+
body > header a:visited {
23+
color: #fff;
24+
text-decoration: none;
25+
}
26+
27+
body > header h1 {
28+
margin: 0;
29+
font-weight: 400;
30+
font-size: 1.75rem;
31+
font-family: "Lora", "Inter", Arial, sans-serif;
32+
line-height: 1em;
33+
}
34+
35+
body > header .clover-repository {
36+
display: flex;
37+
font-size: 1rem;
38+
font-family: "Inter", Arial, sans-serif;
39+
color: #999 !important;
40+
}
41+
42+
body > header .clover-repository svg {
43+
height: 1.75rem;
44+
fill: #fff;
45+
color: #fff;
46+
line-height: 1em;
47+
margin-left: 0.5rem;
48+
}
49+
1350
#root {
14-
padding: 0;
51+
padding: 1.618rem 2.618rem;
1552
}
1653

17-
#root header > span {
18-
font-family: "Calistoga", "Inter", Arial, sans-serif;
54+
#root .documentation-wrapper header > span {
55+
font-family: "Lora", "Inter", Arial, sans-serif;
1956
font-weight: 400;
2057
}
2158

2259
button * {
2360
box-sizing: border-box;
2461
}
2562

26-
h1 {
63+
.documentation-wrapper h1 {
2764
font-weight: 400;
28-
font-family: "Calistoga", "Inter", Arial, sans-serif;
65+
font-family: "Lora", "Inter", Arial, sans-serif;
2966
}
3067

31-
h2 {
68+
.documentation-wrapper h2 {
3269
margin: 2.618rem 0 1rem;
3370
font-weight: 400;
34-
font-family: "Calistoga", "Inter", Arial, sans-serif;
71+
font-family: "Lora", "Inter", Arial, sans-serif;
3572
}
3673

3774
code {

src/components/Viewer/Header.styled.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const IIIFBadgeContent = styled(Popover.Content, {
1414
fontSize: "0.8333rem",
1515
border: "none",
1616
boxShadow: "2px 2px 5px #0003",
17-
marginRight: "1rem",
1817
zIndex: "2",
1918

2019
button: {

src/components/Viewer/Header.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ const ViewerHeader: React.FC<Props> = ({ manifestId, manifestLabel }) => {
2727

2828
const { showTitle, showIIIFBadge, showInformationToggle } = configOptions;
2929

30-
if (!showTitle && !showIIIFBadge) return <></>;
30+
if (
31+
!collection?.items &&
32+
!showTitle &&
33+
!showIIIFBadge &&
34+
!showInformationToggle
35+
)
36+
return <></>;
3137

3238
return (
3339
<Header className="clover-header">
@@ -38,7 +44,6 @@ const ViewerHeader: React.FC<Props> = ({ manifestId, manifestLabel }) => {
3844
<Label label={manifestLabel} />
3945
</ManifestLabel>
4046
)}
41-
{showInformationToggle && <Toggle />}
4247
{showIIIFBadge && (
4348
<Popover>
4449
<IIIFBadgeButton>
@@ -73,6 +78,7 @@ const ViewerHeader: React.FC<Props> = ({ manifestId, manifestLabel }) => {
7378
</IIIFBadgeContent>
7479
</Popover>
7580
)}
81+
{showInformationToggle && <Toggle />}
7682
</Header>
7783
);
7884
};

src/components/Viewer/Toggle.styled.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,36 @@ const StyledSwitch = styled(Switch.Root, {
2323

2424
const StyledThumb = styled(Switch.Thumb, {
2525
display: "block",
26-
height: "calc(2rem - 6px)",
27-
width: "calc(2rem - 6px)",
26+
height: "calc(2rem - 12px)",
27+
width: "calc(2rem - 12px)",
2828
backgroundColor: "$secondary",
2929
borderRadius: "100%",
3030
boxShadow: `2px 2px 5px #0001`,
3131
transition: "$all",
32-
transform: "translateX(3px)",
32+
transform: "translateX(6px)",
3333
willChange: "transform",
3434

3535
'&[data-state="checked"]': {
36-
transform: "translateX(calc(1.236rem + 3px))",
36+
transform: "translateX(calc(1.236rem + 6px))",
3737
},
3838
});
3939

4040
const Wrapper = styled("div", {
4141
display: "flex",
4242
alignItems: "center",
43+
paddingLeft: "1.618rem",
4344
});
4445

4546
const Label = styled("label", {
47+
fontSize: "0.8333rem",
4648
fontFamily: "$sans",
47-
fontWeight: "700",
49+
fontWeight: "400",
4850
lineHeight: "1em",
4951
userSelect: "none",
5052
cursor: "pointer",
5153
color: "$primary",
5254
opacity: "0.7",
53-
paddingRight: "1rem",
55+
paddingRight: "0.618rem",
5456
});
5557

5658
const StyledToggle = styled("form", {});

src/dev.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const Wrapper = () => {
1616
}, []);
1717

1818
const customTheme = {
19-
fonts: { display: `"Calistoga", "Inter", Arial, sans-serif` },
19+
fonts: {
20+
display: `"Lora", "Inter", Arial, sans-serif`,
21+
sans: `"Inter", Arial, sans-serif`,
22+
},
2023
};
2124

2225
return (

utils/html.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ async function buildHTML(isStatic) {
1111
<link rel="stylesheet" href="./styles.css" />
1212
</head>
1313
<body>
14+
<header>
15+
<a href="/" class="clover-title">
16+
<h1>Clover IIIF<h1>
17+
</a>
18+
<a href="https://samvera-labs.github.io/clover-iiif/" class="clover-repository">
19+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
20+
<title>GitHub</title>
21+
<path d="M256 32C132.3 32 32 134.9 32 261.7c0 101.5 64.2 187.5 153.2 217.9a17.56 17.56 0 003.8.4c8.3 0 11.5-6.1 11.5-11.4 0-5.5-.2-19.9-.3-39.1a102.4 102.4 0 01-22.6 2.7c-43.1 0-52.9-33.5-52.9-33.5-10.2-26.5-24.9-33.6-24.9-33.6-19.5-13.7-.1-14.1 1.4-14.1h.1c22.5 2 34.3 23.8 34.3 23.8 11.2 19.6 26.2 25.1 39.6 25.1a63 63 0 0025.6-6c2-14.8 7.8-24.9 14.2-30.7-49.7-5.8-102-25.5-102-113.5 0-25.1 8.7-45.6 23-61.6-2.3-5.8-10-29.2 2.2-60.8a18.64 18.64 0 015-.5c8.1 0 26.4 3.1 56.6 24.1a208.21 208.21 0 01112.2 0c30.2-21 48.5-24.1 56.6-24.1a18.64 18.64 0 015 .5c12.2 31.6 4.5 55 2.2 60.8 14.3 16.1 23 36.6 23 61.6 0 88.2-52.4 107.6-102.3 113.3 8 7.1 15.2 21.1 15.2 42.5 0 30.7-.3 55.5-.3 63 0 5.4 3.1 11.5 11.4 11.5a19.35 19.35 0 004-.4C415.9 449.2 480 363.1 480 261.7 480 134.9 379.7 32 256 32z" />
22+
</svg>
23+
</a>
24+
</header>
1425
<div id="root"></div>
1526
${isStatic ? await buildMarkdown() : ``}
1627
<script src="./script.js"></script>

0 commit comments

Comments
 (0)