['breakpoints'],
): Vt => {
- const usingViewports: Vt[number][] = [
- ...(Object.keys(breakpoints) as (keyof typeof breakpoints)[]),
- ];
+ const usingViewports: Vt[number][] = Object.keys(breakpoints) as (keyof typeof breakpoints)[];
return usingViewports.sort((a, b) =>
viewports.indexOf(a) > viewports.indexOf(b) ? 1 : -1,
diff --git a/src/build/themeProcessors/extractGeneralTokens/extractGeneralTokens.ts b/src/build/themeProcessors/extractGeneralTokens/extractGeneralTokens.ts
index 112ceba0c..122ca2422 100644
--- a/src/build/themeProcessors/extractGeneralTokens/extractGeneralTokens.ts
+++ b/src/build/themeProcessors/extractGeneralTokens/extractGeneralTokens.ts
@@ -18,7 +18,15 @@ export function extractGeneralTokens(
const tokenValue = themeDescription[token];
if (typeof tokenValue === 'function') {
- copyDescription[token] = tokenValue(themeDescription);
+ copyDescription[token] = tokenValue;
+ }
+ }
+
+ for (const token of tokens) {
+ const tokenValue = copyDescription[token];
+
+ if (typeof tokenValue === 'function') {
+ copyDescription[token] = tokenValue(copyDescription);
}
}
diff --git a/src/interfaces/general/colors/index.ts b/src/interfaces/general/colors/index.ts
index 720e29ead..6c664acf9 100644
--- a/src/interfaces/general/colors/index.ts
+++ b/src/interfaces/general/colors/index.ts
@@ -75,6 +75,12 @@ export interface ColorsDescriptionStruct {
*/
colorBackgroundContent: ColorDescription;
+ /**
+ * @desc Цвет фона, противоположный фону контента.
+ * @tags color, background
+ */
+ colorBackgroundContentInverse: ColorDescription;
+
/**
* @desc Второстепенный цвет фона
* @tags color, background
diff --git a/src/interfaces/general/gradients/index.ts b/src/interfaces/general/gradients/index.ts
index f694ff31d..611f9335d 100644
--- a/src/interfaces/general/gradients/index.ts
+++ b/src/interfaces/general/gradients/index.ts
@@ -1,4 +1,5 @@
-export type GradientPoints = string;
+// TODO: Нормальный тип вместо unknown (поправить Type instantiation is excessively deep and possibly infinite)
+export type GradientPoints = string | unknown;
export interface Gradients {
/**
diff --git a/src/themeDescriptions/base/paradigm.ts b/src/themeDescriptions/base/paradigm.ts
index ba265a6fa..9786b2d61 100644
--- a/src/themeDescriptions/base/paradigm.ts
+++ b/src/themeDescriptions/base/paradigm.ts
@@ -31,6 +31,7 @@ export const lightColors: ColorsDescription = {
colorBackgroundAccentThemedAlpha: 'rgba(0, 119, 255, 0.2)',
colorBackgroundAccentAlternative: '#FF9E00',
colorBackgroundContent: '#FFFFFF',
+ colorBackgroundContentInverse: colorBackgroundContentDark,
colorBackgroundSecondary: '#F0F1F3',
colorBackgroundSecondaryAlpha: {
normal: 'rgba(0, 16, 61, 0.06)',
@@ -170,6 +171,7 @@ export const darkColors: ColorsDescription = {
colorBackgroundAccentThemedAlpha: 'rgba(255, 255, 255, 0.2)',
colorBackgroundAccentAlternative: '#FF9E00',
colorBackgroundContent: colorBackgroundContentDark,
+ colorBackgroundContentInverse: '#FFFFFF',
colorBackgroundSecondary: '#2A2A2B',
colorBackgroundSecondaryAlpha: {
normal: 'rgba(255, 255, 255, 0.12)',
diff --git a/src/themeDescriptions/base/vk.ts b/src/themeDescriptions/base/vk.ts
index e5096aa50..fa0d100c5 100644
--- a/src/themeDescriptions/base/vk.ts
+++ b/src/themeDescriptions/base/vk.ts
@@ -37,6 +37,10 @@ export const colorFromFigma = (colorsScheme: 'light' | 'dark'): ColorsDescriptio
}[colorsScheme],
colorBackground: background.background,
colorBackgroundContent: background.background_content,
+ colorBackgroundContentInverse: {
+ light: '#19191A',
+ dark: '#FFFFFF',
+ }[colorsScheme],
colorBackgroundSecondary: background.background_secondary,
colorBackgroundSecondaryAlpha: {
light: {
@@ -223,9 +227,10 @@ export const colorFromFigma = (colorsScheme: 'light' | 'dark'): ColorsDescriptio
// Other
colorOverlayPrimary: other.overlay_primary,
colorOverlaySecondary: {
- light: 'rgba(44, 45, 46, 0.5)',
- dark: 'rgba(55, 56, 57, 0.5)',
- }[colorsScheme],
+ normal: 'rgba(0, 0, 0, 0.27)',
+ hover: 'rgba(0, 0, 0, 0.31)',
+ active: 'rgba(0, 0, 0, 0.35)',
+ },
colorAvatarOverlay: other.avatar_overlay_alpha,
colorAvatarOverlayInverseAlpha: other.avatar_overlay_inverse_alpha,
colorActionSheetText: other.action_sheet_text,
diff --git a/src/themeDescriptions/themes/media/index.ts b/src/themeDescriptions/themes/media/index.ts
index 59b899c79..b73ab36f9 100644
--- a/src/themeDescriptions/themes/media/index.ts
+++ b/src/themeDescriptions/themes/media/index.ts
@@ -7,7 +7,7 @@ import { helpers, projectColors, socialColors } from '@/themeDescriptions/common
import { darkTheme, lightTheme } from '../../base/paradigm';
const { fontWeightBase3 } = lightTheme;
-const { x0, x05, x2, x3, x4, x5, x6, x8, x10, x12 } = helpers;
+const { x0, x05, x2, x3, x4, x5, x6, x8 } = helpers;
const fontFamilyBase: Property.FontFamily = 'Inter, Helvetica, Arial, sans-serif';
const fontFamilyAccent: Property.FontFamily = `VKSansDisplay, MailSans, ${fontFamilyBase}`;
@@ -508,17 +508,23 @@ export const mediaTheme: ThemeMediaDescription = {
*/
sizeFieldHeight: {
- regular: x12,
+ regular: 44,
+ compact: 36,
},
sizeButtonLargeHeight: {
- regular: x12,
+ regular: 44,
+ compact: 36,
},
+
sizeButtonMediumHeight: {
- regular: x10,
+ regular: 36,
+ compact: 32,
},
+
sizeButtonSmallHeight: {
- regular: 36,
+ regular: 30,
+ compact: 28,
},
sizeFieldWidthMin: {
@@ -608,6 +614,25 @@ export const mediaTheme: ThemeMediaDescription = {
regular: x4,
},
+ sizeButtonBaseSmallPaddingHorizontal: {
+ regular: 16,
+ },
+ sizeButtonBaseMediumPaddingHorizontal: {
+ regular: 16,
+ },
+ sizeButtonBaseLargePaddingHorizontal: {
+ regular: 20,
+ },
+ sizeButtonBaseSmallPaddingHorizontalIcon: {
+ regular: 12,
+ },
+ sizeButtonBaseMediumPaddingHorizontalIcon: {
+ regular: 12,
+ },
+ sizeButtonBaseLargePaddingHorizontalIcon: {
+ regular: 16,
+ },
+
/**
* ОТСТУПЫ МЕЖДУ ЭЛЕМЕНТАМИ УПРАВЛЕНИЯ
*/
@@ -694,6 +719,8 @@ export const mediaTheme: ThemeMediaDescription = {
sizeBadgeXL: {
regular: 56,
},
+
+ elevation3: '0px 16px 48px 0px rgba(0, 16, 61, 0.28)',
};
export const mediaDarkTheme: ThemeMediaDescription = {
@@ -704,4 +731,5 @@ export const mediaDarkTheme: ThemeMediaDescription = {
...mediaTheme.colors,
...darkTheme.colors,
},
+ elevation3: '0px 16px 48px 0px rgba(0, 0, 0, 0.40)',
};
diff --git a/src/themeDescriptions/themes/vkCom/index.ts b/src/themeDescriptions/themes/vkCom/index.ts
index b8a9475bb..23797d602 100644
--- a/src/themeDescriptions/themes/vkCom/index.ts
+++ b/src/themeDescriptions/themes/vkCom/index.ts
@@ -1,7 +1,9 @@
import { vkcom_dark, vkcom_light } from '@vkontakte/appearance/main.valette/scheme_web.json';
import lodash from 'lodash';
+import { getGradientPointsFromColor } from '@/build/helpers/getGradientPointsFromColor';
import { ColorsDescription } from '@/interfaces/general';
+import { Gradients } from '@/interfaces/general/gradients';
import { DeepPartial } from '@/interfaces/general/tools/utils';
import { ThemeVkComDescription } from '@/interfaces/themes/vkCom';
import { ThemeVkComDarkDescription } from '@/interfaces/themes/vkComDark';
@@ -32,11 +34,7 @@ const vkComColors = (theme: typeof vkcom_light) => ({
colorBackground: resolveColor(theme.colors.background_page),
colorBackgroundContent: resolveColor(theme.colors.background_content),
colorBackgroundSecondary: resolveColor(theme.colors.content_tint_background),
- colorBackgroundSecondaryAlpha: {
- normal: 'rgba(235, 242, 250, 0.99)',
- hover: 'rgba(223, 234, 246, 0.99)',
- active: 'rgba(213, 226, 241, 0.99)',
- },
+ colorBackgroundSecondaryAlpha: 'rgba(39, 63, 92, 0.07)',
colorBackgroundTertiary: resolveColor(theme.colors.background_light),
colorBackgroundContrast: resolveColor(theme.colors.media_overlay_button_background),
// colorBackgroundContrastSecondaryAlpha: 'rgba(255, 255, 255, 0.20)',
@@ -355,11 +353,7 @@ const vkComDarkColor: ColorsDescription = {
active: '#CFD2D8',
},
colorBackgroundAccentThemedAlpha: 'rgba(255, 255, 255, 0.2)',
- colorBackgroundSecondaryAlpha: {
- normal: 'rgba(255, 255, 255, 0.10)',
- hover: 'rgba(255, 255, 255, 0.12)',
- active: 'rgba(255, 255, 255, 0.14)',
- },
+ colorBackgroundSecondaryAlpha: 'rgba(255, 255, 255, 0.08)',
colorBackgroundContrastThemed: '#323232',
colorBackgroundModalInverse: '#FFFFFF',
@@ -394,10 +388,16 @@ const vkComDarkColor: ColorsDescription = {
},
};
+export const vkComDarkGradient: Gradients = {
+ ...darkGradient,
+ gradientTint: getGradientPointsFromColor(resolveColor(vkcom_dark.colors.background_light)),
+ gradient: getGradientPointsFromColor(resolveColor(vkcom_dark.colors.background_content)),
+};
+
export const vkComThemeDark: ThemeVkComDarkDescription = {
...vkComTheme,
...vkComDarkColor,
- ...darkGradient,
+ ...vkComDarkGradient,
...darkElevation,
themeName: 'vkComDark',
themeNameBase: 'vkCom',
diff --git a/src/themeDescriptions/themes/vkontakteAndroid/index.ts b/src/themeDescriptions/themes/vkontakteAndroid/index.ts
index 77ba55b03..757153aa6 100644
--- a/src/themeDescriptions/themes/vkontakteAndroid/index.ts
+++ b/src/themeDescriptions/themes/vkontakteAndroid/index.ts
@@ -1,5 +1,7 @@
import lodash from 'lodash';
+import { gradient, namedAlias } from '@/build/helpers/tokenHelpers';
+import { Gradients } from '@/interfaces/general/gradients';
import { DeepPartial } from '@/interfaces/general/tools/utils';
import type {
LocalVkontakteAndroidColorsDescriptionStruct,
@@ -223,7 +225,19 @@ export const vkontakteLocalColorDark: LocalVkontakteAndroidColorsDescriptionStru
const fontFamilyAccent =
'"VK Sans Display", -apple-system, system-ui, "Helvetica Neue", Roboto, sans-serif';
-const gradients: VkontakteAndroidGradients = {
+function makeFunctionalGradients(source: T): T {
+ const keys = Object.keys(source);
+ const result: T = {} as any;
+
+ for (const key of keys) {
+ const colors = source[key].split(', ');
+ result[key] = gradient(...colors);
+ }
+
+ return result;
+}
+
+const colorGradients: VkontakteAndroidGradients = makeFunctionalGradients({
vkontakteGradientAquamarineBlue: '#7DF1FA, #2BB4D6',
vkontakteGradientBlue: '#66CCFF, #3F8AE0',
vkontakteGradientCandy: '#FF99CC, #E52E6A',
@@ -258,6 +272,13 @@ const gradients: VkontakteAndroidGradients = {
vkontakteGradientSberkot: '#9DF19D, #31C2A7, #21A19A, #107F8C',
vkontakteGradientMable: '#D9F4FF, #D9F4FF',
vkontakteGradientWomensDay: '#FF99CC, #E52E6A',
+});
+
+const gradients: Gradients = {
+ gradient: gradient(namedAlias('colorBackgroundContent'), 'transparent'),
+ gradientTint: gradient(namedAlias('colorBackgroundTertiary'), 'transparent'),
+ gradientWhite: gradient('#FFFFFF', 'transparent'),
+ gradientBlack: gradient('#00000060', 'transparent'),
};
export const vkontakteDisplayTitleFontsPartial: DeepPartial = {
@@ -386,7 +407,7 @@ const androidFonts: typeof fonts = lodash.merge |