Skip to content

Commit

Permalink
feat/tokenized-gradients: fix doc style
Browse files Browse the repository at this point in the history
  • Loading branch information
8coon committed Sep 25, 2024
1 parent b1f3779 commit 01ee134
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docs/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const router = createBrowserRouter([
)),
]);

router.subscribe(() => {
window.scrollTo(0, 0);
});

const App: FC = () => (
<Main>
<RouterProvider router={router} />
Expand Down
6 changes: 3 additions & 3 deletions docs/src/components/layouts/shared/AsideMenu/AsideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ export function AsideMenu(props: AsideMenuProps) {
{items.map((item) => {
if (item.slug) {
return (
<div className="aside-menu-item">
<div className="aside-menu-item" key={item.title}>
<Link to={`/articles/${item.slug}`}>{item.title}</Link>
</div>
);
} else {
return (
<>
<React.Fragment key={item.title}>
<Spacing size={20}/>
<Title level="3">{item.title}</Title>
<Spacing size={8}/>
</>
</React.Fragment>
)
}
})}
Expand Down
11 changes: 10 additions & 1 deletion docs/src/components/pages/Tokens/TokensHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Icon16Linked } from '@vkontakte/icons';
import { Icon16Linked, Icon16HelpOutline } from '@vkontakte/icons';
import { Link, Title, useAdaptivityWithJSMediaQueries } from '@vkontakte/vkui';
import { Link as RouterLink } from 'react-router-dom';
import clsx from 'clsx';
import React, { FC } from 'react';

Expand Down Expand Up @@ -42,6 +43,14 @@ const TokensHeader: FC = () => {
{version.text}
</Link>
</div>
<div className="flex items-center" style={styles.linkContainer}>
<Icon16HelpOutline style={{ color: '#99A2AD', marginRight: 6 }}/>
<RouterLink to="/articles/new-theme" style={{textDecoration: 'none'}}>
<Link>
Документация
</Link>
</RouterLink>
</div>
<div className="flex items-center" style={styles.linkContainer}>
<Icon16Linked style={{ color: '#99A2AD', marginRight: 6 }} />
<Link href="https://github.com/VKCOM/vkui-tokens" target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/Articles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function Articles(props: ArticlesProps) {
const link = links[i] as HTMLElement;
link.setAttribute("target", "_blank");
}
}, [ref.current]);
}, [ref.current, articleContent]);

return (
<div className={`articles ${isMobile ? 'articles__mobile' : ''}`}>
Expand Down
3 changes: 3 additions & 0 deletions docs/src/styles/articles.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@

.articles a, .articles a:visited {
color: var(--vkui--color_text_link);
text-decoration: none;
}

.articles a:hover {
color: var(--vkui--color_text_link--hover);
text-decoration: underline;
}

.articles a:active {
color: var(--vkui--color_text_link--active);
text-decoration: underline;
}

.articles-container code {
Expand Down
2 changes: 1 addition & 1 deletion src/build/helpers/tokenHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function makeOpacityPoints(count: number): OpacityPoints {
return result;
}

export function gradient<T extends ThemeDescription> (
export function gradient<T extends ThemeDescription>(
...stops: (Property.Color | NamedTokenFunction<T>)[]
): TokenFunction<T> {
const opacityPoints = stops.length > 1 ? makeOpacityPoints(stops.length) : defaultOpacityPoints;
Expand Down

0 comments on commit 01ee134

Please sign in to comment.