Skip to content

Commit 2f67d7d

Browse files
authored
Update translations and improve accessibility in documentation compon… (#311)
2 parents ff2c738 + ea706a1 commit 2f67d7d

File tree

7 files changed

+111
-130
lines changed

7 files changed

+111
-130
lines changed

docusaurus.config.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ const config: Config = {
7676
},
7777
items: [
7878
{
79-
type: 'docsVersionDropdown',
80-
position: 'left',
81-
dropdownActiveClassDisabled: true,
82-
dropdownItemsAfter: [
79+
label: 'Version 2',
80+
position: 'right',
81+
items: [
8382
{
8483
type: 'html',
8584
className: 'dropdown-archived-versions',

i18n/de/code.json

Lines changed: 67 additions & 116 deletions
Large diffs are not rendered by default.

i18n/en/code.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,6 @@
352352
"message": "View the example of the component"
353353
},
354354
"custom.docs-version-hint": {
355-
"message": "This documentation covers KoliBri - Public UI {version} LTS. You can find the latest documentation here: {link}"
355+
"message": "This documentation covers KoliBri - Public UI {version}. For the latest version, see {link}."
356356
}
357357
}

src/components/DocumentationVersionHint.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ export default function DocumentationVersionHint(): ReactNode {
1212
values={{
1313
link: (
1414
<KolLink
15-
style={{ padding: '0 .5rem' }}
15+
style={{
16+
padding: '0 .25rem',
17+
}}
1618
_href={`https://public-ui.github.io${i18n.currentLocale === 'en' ? '/en' : ''}`}
1719
_label={'https://public-ui.github.io'}
1820
></KolLink>
1921
),
20-
version: <b>2.2</b>,
22+
version: <b>v2 (LTS)</b>,
2123
}}
2224
/>
2325
</p>

src/css/custom.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ kol-link-button {
193193
background: linear-gradient(90deg, #facc15, #fbbf24); /* leichter gelber Verlauf */
194194
color: #1f2937; /* dunkles Grau für gute Lesbarkeit */
195195
font-weight: 500;
196+
margin: 0;
196197
text-align: center;
197-
padding: 0.75rem 1rem;
198-
font-size: 0.95rem;
198+
padding: 0.5rem 1rem;
199+
font-size: 0.8rem;
199200
border-bottom: 1px solid #e5e7eb; /* feine untere Linie */
200201
position: sticky;
201202
top: 0;

src/theme/Navbar/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import React from 'react';
55
import { LanguageSwitch } from '@site/src/components/LanguageSwitch';
66
import Navbar from '@theme-original/Navbar';
77
import { translate } from '@docusaurus/Translate';
8-
import DocumentationVersionHint from '../../components/DocumentationVersionHint';
98

109
export const NavbarWrapper: FunctionComponent<PropsWithChildren> = (props) => {
1110
// const [dark, setDark] = useState(false);
@@ -25,7 +24,7 @@ export const NavbarWrapper: FunctionComponent<PropsWithChildren> = (props) => {
2524

2625
return (
2726
<div className="kolibri-navbar-wrapper sticky top-0 z-50 bg-white">
28-
<DocumentationVersionHint />
27+
{/* <DocumentationVersionHint /> */}
2928
<div className="kolibri-navbar max-w-screen-md lg:max-w-4xl 2xl:max-w-[95rem] mx-auto grid grid-cols-[1fr,auto] gap-y-2 items-center 2xl:grid-cols-[1fr,auto,auto,auto] p-4 lg:px-8">
3029
<Navbar {...props} />
3130
<section aria-label="Toolbar" className="flex flex-wrap gap-2 col-span-2">
@@ -49,7 +48,7 @@ export const NavbarWrapper: FunctionComponent<PropsWithChildren> = (props) => {
4948
</div> */}
5049
<div>
5150
<KolLinkButton
52-
_href="https://github.com/public-ui/kolibri"
51+
_href="https://github.com/public-ui/kolibri/tree/release/2"
5352
_icons={'codicon codicon-github'}
5453
_hideLabel
5554
_label="GitHub-Repository"

src/theme/Root.tsx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { register } from '@public-ui/components';
1+
import { KoliBriDevHelper, register } from '@public-ui/components';
22
import { defineCustomElements } from '@public-ui/components/dist/loader';
33
import { DEFAULT } from '@public-ui/theme-default';
44
import type { FunctionComponent, PropsWithChildren } from 'react';
@@ -10,7 +10,36 @@ export const Root: FunctionComponent<PropsWithChildren> = (props) => {
1010
theme: {
1111
detect: 'fixed',
1212
},
13-
}).catch(console.warn);
13+
})
14+
.then(() => {
15+
KoliBriDevHelper.patchTheme(
16+
'default',
17+
{
18+
'KOL-BUTTON-LINK': `
19+
:host,
20+
button {
21+
font-size: inherit;
22+
}
23+
`,
24+
'KOL-ICON': `
25+
:host {
26+
color: inherit;
27+
font-size: inherit;
28+
}
29+
`,
30+
'KOL-LINK': `
31+
:host,
32+
a {
33+
font-size: inherit;
34+
}
35+
`,
36+
},
37+
{
38+
append: true,
39+
}
40+
);
41+
})
42+
.catch(console.warn);
1443
}, []);
1544

1645
return <div id="doc-app">{props.children}</div>;

0 commit comments

Comments
 (0)