Skip to content
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

Add dobro theme #698

Merged
merged 5 commits into from
Jan 30, 2024
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
53 changes: 53 additions & 0 deletions src/interfaces/themes/dobro/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import type { Theme, ThemeCssVars, ThemeDescription } from '@/interfaces/general';
import type { Adaptive } from '@/interfaces/general/tools';
import type { Fonts, TypographyBaseProps } from '@/interfaces/general/typography';

export interface ThemeDobro
extends Theme,
ThemeDobroMedia,

Check failure on line 7 in src/interfaces/themes/dobro/index.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `↹`
ThemeDobroCustomTokens,

Check failure on line 8 in src/interfaces/themes/dobro/index.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `↹`
ThemeDobroFonts { }

Check failure on line 9 in src/interfaces/themes/dobro/index.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `ThemeDobroFonts·{·` with `↹ThemeDobroFonts·{`

export interface ThemeDobroDescription
extends ThemeDescription,
ThemeDobroMedia,

Check failure on line 13 in src/interfaces/themes/dobro/index.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `↹`
ThemeDobroCustomTokens,

Check failure on line 14 in src/interfaces/themes/dobro/index.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `↹`
ThemeDobroFonts { }

Check failure on line 15 in src/interfaces/themes/dobro/index.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `ThemeDobroFonts·{·` with `↹ThemeDobroFonts·{`

export interface ThemeDobroCssVars extends ThemeCssVars<ThemeDobro> { }

Check failure on line 17 in src/interfaces/themes/dobro/index.ts

View workflow job for this annotation

GitHub Actions / lint

Delete `·`

interface ThemeDobroCustomTokens {
dobroPortalZIndex: number;
dobroPopoutZIndex: number;
dobroModalZIndex: number;
dobroMenuZIndex: number;
}

export interface ThemeDobroFonts {
dobroFontFamily600: string;
dobroFontFamily500: string;
dobroFontFamily400: string;
}

export interface ThemeDobroMedia {
dobroLayoutWidthToMobileS: string;
dobroLayoutWidthMobileM: string;
dobroLayoutWidthToMobileM: string;
dobroLayoutWidthMobileL: string;
dobroLayoutWidthToMobile: string;
dobroLayoutWidthFromTablet: string;
dobroLayoutWidthTablet: string;
dobroLayoutWidthToTablet: string;
dobroLayoutWidthFromDesktopS: string;
dobroLayoutWidthDesktopS: string;
dobroLayoutWidthToDesktopS: string;
dobroLayoutWidthDesktopM: string;
}

export type BaseFonts = Omit<
{
[key in keyof Fonts]: Adaptive<Fonts[key]>;
},
'fontHeadline'
> &
TypographyBaseProps;
5 changes: 5 additions & 0 deletions src/interfaces/themes/dobroDark/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { ThemeDobro, ThemeDobroCssVars, ThemeDobroDescription } from '../dobro';

export type ThemeDobroDark = ThemeDobro;
export type ThemeDobroDarkDescription = ThemeDobroDescription;
export type ThemeDobroDarkCssVars = ThemeDobroCssVars;
5 changes: 5 additions & 0 deletions src/themeDescriptions/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { calendarDarkTheme, calendarTheme } from '@/themeDescriptions/themes/calendar';
import { callsTheme } from '@/themeDescriptions/themes/calls';
import { cloudDarkTheme, cloudTheme } from '@/themeDescriptions/themes/cloud';
import { dobroDarkTheme, dobroTheme } from '@/themeDescriptions/themes/dobro';
import { homeDarkTheme, homeTheme } from '@/themeDescriptions/themes/home';
import { mediaDarkTheme, mediaTheme } from '@/themeDescriptions/themes/media';
import { mycomTheme } from '@/themeDescriptions/themes/mycom';
Expand Down Expand Up @@ -86,6 +87,10 @@ export const themes = [
cloudTheme,
cloudDarkTheme,

// Темы, наследуемые от Dobro
dobroTheme,
dobroDarkTheme,

// Темы, наследуемые от PortalUI
portalUITheme,
portalUIDarkTheme,
Expand Down
54 changes: 54 additions & 0 deletions src/themeDescriptions/themes/dobro/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import type { ColorsDescription } from '@/interfaces/general';
import type { ThemeDobroDescription } from '@/interfaces/themes/dobro';
import {
colorFromFigma,
darkElevation,
darkGradient,
fonts,
lightTheme,
} from '@/themeDescriptions/base/vk';

const lightColors: ColorsDescription = colorFromFigma('light');

const darkColors: ColorsDescription = colorFromFigma('dark');

export const dobroTheme: ThemeDobroDescription = {
...lightTheme,
...lightColors,
...fonts,

themeName: 'dobro',
themeNameBase: 'dobro',

dobroFontFamily600: 'VK Sans Display, sans-serif, Arial',
dobroFontFamily500: 'VK Sans Display Medium, sans-serif, Arial',
dobroFontFamily400: 'VK Sans Display Regular, sans-serif, Arial',

dobroPortalZIndex: 96,
dobroPopoutZIndex: 96,
dobroModalZIndex: 97,
dobroMenuZIndex: 98,

dobroLayoutWidthToMobileS: '(max-width: 499px)',
dobroLayoutWidthMobileM: '(min-width: 500px) and (max-width: 637px)',
dobroLayoutWidthToMobileM: '(max-width: 638px)',
dobroLayoutWidthMobileL: '(min-width: 639px) and (max-width: 767px)',
dobroLayoutWidthToMobile: '(max-width: 767px)',
dobroLayoutWidthFromTablet: '(min-width: 768px)',
dobroLayoutWidthTablet: '(min-width: 768px) and (max-width: 1003px)',
dobroLayoutWidthToTablet: '(max-width: 1003px)',
dobroLayoutWidthFromDesktopS: '(min-width: 1004px)',
dobroLayoutWidthDesktopS: '(min-width: 1004px) and (max-width: 1244px)',
dobroLayoutWidthToDesktopS: '(max-width: 1244px)',
dobroLayoutWidthDesktopM: '(min-width: 1245px)',
};

export const dobroDarkTheme: ThemeDobroDescription = {
...dobroTheme,
...darkColors,
...darkGradient,
...darkElevation,
themeName: 'dobroDark',
themeInheritsFrom: 'dobro',
colorsScheme: 'dark',
};
Loading