Skip to content

Tweak fonts in docs #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ theme:
name: material
language: 'en'
favicon: 'favicon.ico'
font: false
custom_dir: 'src/docs/_overrides'
palette:
- media: "(prefers-color-scheme: light)"
Expand All @@ -48,7 +49,7 @@ theme:
extra_css:
- https://unpkg.com/[email protected]/themes/prism-twilight.min.css # Prism JS syntax highlighting
- docs/_assets/stylesheets/extra.css # mkDocs theme tweaks
- docs/_assets/generated/docs-custom-properties.development.css # Load React UI CSS custom properties to make them accessible in the document root (outside shadowDOM) so we can preview colors etc.
- docs/_assets/generated/docs-custom-properties.development.css # Load React UI CSS custom properties to make them accessible in the document root (outside Shadow DOM), so we can set the root font size and preview colors and helpers/utilities.

# Additional JS. Mind the order!
extra_javascript:
Expand Down
2 changes: 1 addition & 1 deletion src/components/Alert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ See [API](#api) for all available options.
## Color Variants

To cover all possible needs of your project, Alert is available in colors from
[Feedback and Neutral color collections](/docs/foundation/collections#colors).
[Feedback color collection](/docs/foundation/collections#colors).

### Success

Expand Down
13 changes: 7 additions & 6 deletions src/components/FormLayout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ This is a demo of all components supported by FormLayout.

```docoff-react-preview
React.createElement(() => {
const [fieldLayout, setFieldLayout] = React.useState('vertical');
const [fieldLayout, setFieldLayout] = React.useState('horizontal');
const [fruit, setFruit] = React.useState('apple');
const [isDeliveryAddress, setIsDeliveryAddress] = React.useState(true);
const [receiveNewsletter, setReceiveNewsletter] = React.useState(true);
Expand All @@ -323,16 +323,16 @@ React.createElement(() => {
<Toolbar>
<ToolbarItem>
<ButtonGroup>
<Button
color={fieldLayout === 'vertical' ? 'selected' : 'secondary'}
label="Vertical layout"
onClick={() => setFieldLayout('vertical')}
/>
<Button
color={fieldLayout === 'horizontal' ? 'selected' : 'secondary'}
label="Horizontal layout"
onClick={() => setFieldLayout('horizontal')}
/>
<Button
color={fieldLayout === 'vertical' ? 'selected' : 'secondary'}
label="Vertical layout"
onClick={() => setFieldLayout('vertical')}
/>
</ButtonGroup>
</ToolbarItem>
</Toolbar>
Expand Down Expand Up @@ -388,6 +388,7 @@ React.createElement(() => {
rows={3}
/>
<FileInputField
id="my-file"
label="Attachment"
onFilesChanged={() => {}}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/InputGroup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ supports this kind of layout as well.
label="Horizontal layout"
layout="horizontal"
>
<FileInputField label="Attachment" onFilesChanged={() => {}} />
<FileInputField id="my-file" label="Attachment" onFilesChanged={() => {}} />
<Button label="Submit" />
</InputGroup>
```
Expand Down
17 changes: 7 additions & 10 deletions src/docs/_assets/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@
/* stylelint-enable */

--docoff-code-line-height: 1.5;
--docoff-code-font-family:
"SFMono-Regular",
"Menlo",
"Monaco",
"Consolas",
"Liberation Mono",
"Courier New",
monospace;
--docoff-code-font-family: var(--rui-font-family-monospace);

/* Visual configuration of the `<docoff-react-preview>` live preview */
--docoff-preview-border-color: #ced4de;
Expand Down Expand Up @@ -76,13 +69,17 @@

/* Document */
html {
font-size: 100%;
/* DO NOT CHANGE THE FONT SIZE. `rem` in docoff previews is calculated from the root font size which is this. */
font-size: var(--rui-font-size-base);
scroll-padding-top: 3.2rem;
scroll-margin-top: 4rem;
}

body {
font-size: 1rem;
--md-text-font-family: var(--rui-font-family-base);
--md-code-font-family: var(--rui-font-family-monospace);

font-size: 1em;
background-color: var(--md-default-bg-color);
}

Expand Down
2 changes: 0 additions & 2 deletions src/docs/_overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

{% block site_meta %}
{{ super() }}
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link rel="preconnect" href="https://unpkg.com" />
{% endblock %}
3 changes: 1 addition & 2 deletions src/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
@use "styles/theme-constants/svg";

@layer theme {
:root,
:host {
:root {
// ============================================================================================ //
// GLOBAL TOKENS //
// ============================================================================================ //
Expand Down