Skip to content

Commit 421812c

Browse files
authored
Merge pull request #1619 from oasisprotocol/matevz/fix/titles-example-core-icon
Bunch of UI fixes
2 parents 3b7bdaf + 96b6efa commit 421812c

File tree

4 files changed

+43
-29
lines changed

4 files changed

+43
-29
lines changed

src/components/DocCardSection.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
.cardItem a h3 {
9797
font-size: 1rem !important;
9898
margin: 0;
99-
font-weight: 600 !important;
10099
color: var(--ifm-color-card-heading-secondary);
101100
transition: all .2s ease;
102101
}
@@ -237,4 +236,4 @@ html[data-theme='dark'] .cardItem::after {
237236
flex-direction: column;
238237
gap: 1.5rem;
239238
}
240-
}
239+
}

src/css/custom.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@
1717
--ifm-code-font-size: 95%;
1818
--ifm-font-family-base: "Inter Variable", sans-serif;
1919
--ifm-font-family-monospace: "Roboto Mono", monospace;
20+
--ifm-font-weight-bold: 640;
2021
--ifm-global-radius: 0;
2122
--ifm-alert-border-width: 5px;
22-
--docusaurus-highlighted-code-line-bg: #dddfe1;
23+
--docusaurus-highlighted-code-line-bg: #e8e8ff;
2324
--ifm-color-secondary-text: #71717A;
2425
--ifm-color-card-heading: #09090B;
2526
--ifm-color-card-heading-secondary: #18181B;
2627
--ifm-alert-foreground: #EF4444;
2728
--ifm-alert-background: #FEF2F2;
2829
--ifm-note-foreground: #71717A;
2930
--ifm-note-background: #F4F4F5;
30-
--ifm-caution-foreground: #FB923C;
31+
--ifm-caution-foreground: #FB843C;
3132
--ifm-caution-background: #FFF7ED;
3233
--ifm-info-foreground: #3B82F6;
3334
--ifm-info-background: #EFF6FF;
@@ -46,7 +47,7 @@ html[data-theme='dark'] {
4647
--ifm-color-primary-light: #00ffff;
4748
--ifm-color-primary-lighter: #00ffff;
4849
--ifm-color-primary-lightest: #00ffff;
49-
--docusaurus-highlighted-code-line-bg: #646464;
50+
--docusaurus-highlighted-code-line-bg: #343484;
5051
--ifm-color-secondary-text: #A1A1AA;
5152
--ifm-color-card-heading: #FAFAFA;
5253
--ifm-color-card-heading-secondary: #FAFAFA;
@@ -80,10 +81,15 @@ html[data-theme='dark'] {
8081
src: url("/static/fonts/RobotoMono-Regular.ttf") format("truetype");
8182
}
8283

84+
/* https://github.com/facebook/docusaurus/issues/10652 */
85+
code {
86+
vertical-align: baseline;
87+
}
88+
8389
h1, h2, h3, h4, h5, h6 {
8490
font-family: "Inter Variable", sans-serif;
8591
letter-spacing: -0.04em;
86-
font-weight: 600;
92+
font-weight: 400;
8793
}
8894

8995
article strong {

src/theme/Admonition/Types.tsx

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
1-
import React from 'react';
1+
import React, {type ReactNode} from 'react';
22
import DefaultAdmonitionTypes from '@theme-original/Admonition/Types';
3+
import Translate from "@docusaurus/Translate";
4+
import type {Props} from "@theme/Admonition/Type/Danger";
5+
import AdmonitionLayout from "@theme/Admonition/Layout";
6+
import clsx from "clsx";
37

4-
function ExampleAdmonition(props: any) {
8+
const infimaClassName = 'alert alert--example';
9+
10+
const defaultProps = {
11+
icon: <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="transparent">
12+
<path d="M15.0002 12L6.62718 20.373C6.22935 20.7708 5.68979 20.9943 5.12718 20.9943C4.56457 20.9943 4.025 20.7708 3.62718 20.373C3.22936 19.9752 3.00586 19.4356 3.00586 18.873C3.00586 18.3104 3.22936 17.7708 3.62718 17.373L12.0002 9M18 15L22 11M21.5 11.5L19.586 9.58596C19.2109 9.21098 19.0001 8.70235 19 8.17196V6.99996L16.74 4.73996C15.6245 3.62515 14.115 2.99432 12.538 2.98396L9 2.95996L9.92 3.77996C10.5735 4.35935 11.0967 5.07066 11.4552 5.867C11.8137 6.66335 11.9994 7.52663 12 8.39996V9.99996L14 12H15.172C15.7024 12.0001 16.211 12.2109 16.586 12.586L18.5 14.5"
13+
stroke="currentColor"
14+
stroke-width="2"
15+
stroke-linecap="round"
16+
stroke-linejoin="round"
17+
/>
18+
</svg>,
19+
title: (
20+
<Translate
21+
id="theme.admonition.example"
22+
description="The default label used for the Example admonition (:::example)">
23+
example
24+
</Translate>
25+
),
26+
};
27+
28+
function ExampleAdmonition(props: Props): ReactNode {
529
return (
6-
<div className="theme-admonition theme-admonition-example alert alert--example" style={{ marginBottom: '1rem' }}>
7-
<div style={{display: 'flex', textTransform: 'uppercase', alignItems: 'center', gap: '0.4rem', marginBottom: '0.3rem'}}>
8-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="transparent">
9-
<path d="M15.0002 12L6.62718 20.373C6.22935 20.7708 5.68979 20.9943 5.12718 20.9943C4.56457 20.9943 4.025 20.7708 3.62718 20.373C3.22936 19.9752 3.00586 19.4356 3.00586 18.873C3.00586 18.3104 3.22936 17.7708 3.62718 17.373L12.0002 9M18 15L22 11M21.5 11.5L19.586 9.58596C19.2109 9.21098 19.0001 8.70235 19 8.17196V6.99996L16.74 4.73996C15.6245 3.62515 14.115 2.99432 12.538 2.98396L9 2.95996L9.92 3.77996C10.5735 4.35935 11.0967 5.07066 11.4552 5.867C11.8137 6.66335 11.9994 7.52663 12 8.39996V9.99996L14 12H15.172C15.7024 12.0001 16.211 12.2109 16.586 12.586L18.5 14.5"
10-
stroke="currentColor"
11-
stroke-width="2"
12-
stroke-linecap="round"
13-
stroke-linejoin="round"
14-
/>
15-
</svg>
16-
<h5 style={{marginBottom: '0'}}>{props.title}</h5>
17-
</div>
18-
<div>{props.children}</div>
19-
</div>
30+
<AdmonitionLayout
31+
{...defaultProps}
32+
{...props}
33+
className={clsx(infimaClassName, props.className)}>
34+
{props.children}
35+
</AdmonitionLayout>
2036
);
2137
}
2238

static/img/CoreGraphic.svg

Lines changed: 0 additions & 7 deletions
Loading

0 commit comments

Comments
 (0)