Skip to content

Commit

Permalink
fix(vkontakte): themeNameBase
Browse files Browse the repository at this point in the history
Исправляем themeNameBase для тем vkontakte*
  • Loading branch information
SevereCloud committed Aug 23, 2023
1 parent 6ab247b commit 13c61d3
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 50 deletions.
95 changes: 51 additions & 44 deletions src/build/__snapshots__/snapthots.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -308050,13 +308050,17 @@ exports[`shapshots vkontakteAndroid theme should match cssVars snapshot 1`] = `
"name": "--vkui--spacing_size_xs",
"value": "var(--vkui--spacing_size_xs, 4px)",
},
"themeInheritsFrom": {
"name": "--vkui--theme_inherits_from",
"value": "var(--vkui--theme_inherits_from, vkBase)",
},
"themeName": {
"name": "--vkui--theme_name",
"value": "var(--vkui--theme_name, vkontakteAndroid)",
},
"themeNameBase": {
"name": "--vkui--theme_name_base",
"value": "var(--vkui--theme_name_base, vkBase)",
"value": "var(--vkui--theme_name_base, vkontakteAndroid)",
},
"themeType": "cssVars",
"vkontakteBackgroundHoverAlpha": {
Expand Down Expand Up @@ -309967,8 +309971,9 @@ exports[`shapshots vkontakteAndroid theme should match pixelify theme snapshot 1
"spacingSizeS": "6px",
"spacingSizeXl": "12px",
"spacingSizeXs": "4px",
"themeInheritsFrom": "vkBase",
"themeName": "vkontakteAndroid",
"themeNameBase": "vkBase",
"themeNameBase": "vkontakteAndroid",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(0, 0, 0, 0.12)",
Expand Down Expand Up @@ -311212,8 +311217,9 @@ exports[`shapshots vkontakteAndroid theme should match pseudo theme from CssVars
"spacingSizeS": "var(--vkui--spacing_size_s, 6px)",
"spacingSizeXl": "var(--vkui--spacing_size_xl, 12px)",
"spacingSizeXs": "var(--vkui--spacing_size_xs, 4px)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkBase)",
"themeName": "var(--vkui--theme_name, vkontakteAndroid)",
"themeNameBase": "var(--vkui--theme_name_base, vkBase)",
"themeNameBase": "var(--vkui--theme_name_base, vkontakteAndroid)",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "var(--vkui--vkontakte_background_hover_alpha--active, rgba(0, 0, 0, 0.12))",
Expand Down Expand Up @@ -312457,8 +312463,9 @@ exports[`shapshots vkontakteAndroid theme should match root theme snapshot 1`] =
"spacingSizeS": 6,
"spacingSizeXl": 12,
"spacingSizeXs": 4,
"themeInheritsFrom": "vkBase",
"themeName": "vkontakteAndroid",
"themeNameBase": "vkBase",
"themeNameBase": "vkontakteAndroid",
"themeType": "root",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(0, 0, 0, 0.12)",
Expand Down Expand Up @@ -315741,15 +315748,15 @@ exports[`shapshots vkontakteAndroidDark theme should match cssVars snapshot 1`]
},
"themeInheritsFrom": {
"name": "--vkui--theme_inherits_from",
"value": "var(--vkui--theme_inherits_from, vkBase)",
"value": "var(--vkui--theme_inherits_from, vkBaseDark)",
},
"themeName": {
"name": "--vkui--theme_name",
"value": "var(--vkui--theme_name, vkontakteAndroidDark)",
},
"themeNameBase": {
"name": "--vkui--theme_name_base",
"value": "var(--vkui--theme_name_base, vkBase)",
"value": "var(--vkui--theme_name_base, vkontakteAndroid)",
},
"themeType": "cssVars",
"vkontakteBackgroundHoverAlpha": {
Expand Down Expand Up @@ -317660,9 +317667,9 @@ exports[`shapshots vkontakteAndroidDark theme should match pixelify theme snapsh
"spacingSizeS": "6px",
"spacingSizeXl": "12px",
"spacingSizeXs": "4px",
"themeInheritsFrom": "vkBase",
"themeInheritsFrom": "vkBaseDark",
"themeName": "vkontakteAndroidDark",
"themeNameBase": "vkBase",
"themeNameBase": "vkontakteAndroid",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(255, 255, 255, 0.12)",
Expand Down Expand Up @@ -318906,9 +318913,9 @@ exports[`shapshots vkontakteAndroidDark theme should match pseudo theme from Css
"spacingSizeS": "var(--vkui--spacing_size_s, 6px)",
"spacingSizeXl": "var(--vkui--spacing_size_xl, 12px)",
"spacingSizeXs": "var(--vkui--spacing_size_xs, 4px)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkBase)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkBaseDark)",
"themeName": "var(--vkui--theme_name, vkontakteAndroidDark)",
"themeNameBase": "var(--vkui--theme_name_base, vkBase)",
"themeNameBase": "var(--vkui--theme_name_base, vkontakteAndroid)",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "var(--vkui--vkontakte_background_hover_alpha--active, rgba(255, 255, 255, 0.12))",
Expand Down Expand Up @@ -320152,9 +320159,9 @@ exports[`shapshots vkontakteAndroidDark theme should match root theme snapshot 1
"spacingSizeS": 6,
"spacingSizeXl": 12,
"spacingSizeXs": 4,
"themeInheritsFrom": "vkBase",
"themeInheritsFrom": "vkBaseDark",
"themeName": "vkontakteAndroidDark",
"themeNameBase": "vkBase",
"themeNameBase": "vkontakteAndroid",
"themeType": "root",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(255, 255, 255, 0.12)",
Expand Down Expand Up @@ -323437,15 +323444,15 @@ exports[`shapshots vkontakteCom theme should match cssVars snapshot 1`] = `
},
"themeInheritsFrom": {
"name": "--vkui--theme_inherits_from",
"value": "var(--vkui--theme_inherits_from, vkBase)",
"value": "var(--vkui--theme_inherits_from, vkCom)",
},
"themeName": {
"name": "--vkui--theme_name",
"value": "var(--vkui--theme_name, vkontakteCom)",
},
"themeNameBase": {
"name": "--vkui--theme_name_base",
"value": "var(--vkui--theme_name_base, vkCom)",
"value": "var(--vkui--theme_name_base, vkontakteCom)",
},
"themeType": "cssVars",
"vkontakteBackgroundHoverAlpha": {
Expand Down Expand Up @@ -325356,9 +325363,9 @@ exports[`shapshots vkontakteCom theme should match pixelify theme snapshot 1`] =
"spacingSizeS": "6px",
"spacingSizeXl": "12px",
"spacingSizeXs": "4px",
"themeInheritsFrom": "vkBase",
"themeInheritsFrom": "vkCom",
"themeName": "vkontakteCom",
"themeNameBase": "vkCom",
"themeNameBase": "vkontakteCom",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(174, 183, 194, 0.2)",
Expand Down Expand Up @@ -326602,9 +326609,9 @@ exports[`shapshots vkontakteCom theme should match pseudo theme from CssVars 1`]
"spacingSizeS": "var(--vkui--spacing_size_s, 6px)",
"spacingSizeXl": "var(--vkui--spacing_size_xl, 12px)",
"spacingSizeXs": "var(--vkui--spacing_size_xs, 4px)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkBase)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkCom)",
"themeName": "var(--vkui--theme_name, vkontakteCom)",
"themeNameBase": "var(--vkui--theme_name_base, vkCom)",
"themeNameBase": "var(--vkui--theme_name_base, vkontakteCom)",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "var(--vkui--vkontakte_background_hover_alpha--active, rgba(174, 183, 194, 0.2))",
Expand Down Expand Up @@ -327848,9 +327855,9 @@ exports[`shapshots vkontakteCom theme should match root theme snapshot 1`] = `
"spacingSizeS": 6,
"spacingSizeXl": 12,
"spacingSizeXs": 4,
"themeInheritsFrom": "vkBase",
"themeInheritsFrom": "vkCom",
"themeName": "vkontakteCom",
"themeNameBase": "vkCom",
"themeNameBase": "vkontakteCom",
"themeType": "root",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(174, 183, 194, 0.2)",
Expand Down Expand Up @@ -331133,15 +331140,15 @@ exports[`shapshots vkontakteComDark theme should match cssVars snapshot 1`] = `
},
"themeInheritsFrom": {
"name": "--vkui--theme_inherits_from",
"value": "var(--vkui--theme_inherits_from, vkBaseDark)",
"value": "var(--vkui--theme_inherits_from, vkComDark)",
},
"themeName": {
"name": "--vkui--theme_name",
"value": "var(--vkui--theme_name, vkontakteComDark)",
},
"themeNameBase": {
"name": "--vkui--theme_name_base",
"value": "var(--vkui--theme_name_base, vkCom)",
"value": "var(--vkui--theme_name_base, vkontakteCom)",
},
"themeType": "cssVars",
"vkontakteBackgroundHoverAlpha": {
Expand Down Expand Up @@ -333052,9 +333059,9 @@ exports[`shapshots vkontakteComDark theme should match pixelify theme snapshot 1
"spacingSizeS": "6px",
"spacingSizeXl": "12px",
"spacingSizeXs": "4px",
"themeInheritsFrom": "vkBaseDark",
"themeInheritsFrom": "vkComDark",
"themeName": "vkontakteComDark",
"themeNameBase": "vkCom",
"themeNameBase": "vkontakteCom",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(255, 255, 255, 0.16)",
Expand Down Expand Up @@ -334298,9 +334305,9 @@ exports[`shapshots vkontakteComDark theme should match pseudo theme from CssVars
"spacingSizeS": "var(--vkui--spacing_size_s, 6px)",
"spacingSizeXl": "var(--vkui--spacing_size_xl, 12px)",
"spacingSizeXs": "var(--vkui--spacing_size_xs, 4px)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkBaseDark)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkComDark)",
"themeName": "var(--vkui--theme_name, vkontakteComDark)",
"themeNameBase": "var(--vkui--theme_name_base, vkCom)",
"themeNameBase": "var(--vkui--theme_name_base, vkontakteCom)",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "var(--vkui--vkontakte_background_hover_alpha--active, rgba(255, 255, 255, 0.16))",
Expand Down Expand Up @@ -335544,9 +335551,9 @@ exports[`shapshots vkontakteComDark theme should match root theme snapshot 1`] =
"spacingSizeS": 6,
"spacingSizeXl": 12,
"spacingSizeXs": 4,
"themeInheritsFrom": "vkBaseDark",
"themeInheritsFrom": "vkComDark",
"themeName": "vkontakteComDark",
"themeNameBase": "vkCom",
"themeNameBase": "vkontakteCom",
"themeType": "root",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(255, 255, 255, 0.16)",
Expand Down Expand Up @@ -338829,15 +338836,15 @@ exports[`shapshots vkontakteIOS theme should match cssVars snapshot 1`] = `
},
"themeInheritsFrom": {
"name": "--vkui--theme_inherits_from",
"value": "var(--vkui--theme_inherits_from, vkBase)",
"value": "var(--vkui--theme_inherits_from, vkIOS)",
},
"themeName": {
"name": "--vkui--theme_name",
"value": "var(--vkui--theme_name, vkontakteIOS)",
},
"themeNameBase": {
"name": "--vkui--theme_name_base",
"value": "var(--vkui--theme_name_base, vkIOS)",
"value": "var(--vkui--theme_name_base, vkontakteIOS)",
},
"themeType": "cssVars",
"vkontakteBackgroundHoverAlpha": {
Expand Down Expand Up @@ -340748,9 +340755,9 @@ exports[`shapshots vkontakteIOS theme should match pixelify theme snapshot 1`] =
"spacingSizeS": "6px",
"spacingSizeXl": "12px",
"spacingSizeXs": "4px",
"themeInheritsFrom": "vkBase",
"themeInheritsFrom": "vkIOS",
"themeName": "vkontakteIOS",
"themeNameBase": "vkIOS",
"themeNameBase": "vkontakteIOS",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(0, 0, 0, 0.12)",
Expand Down Expand Up @@ -341994,9 +342001,9 @@ exports[`shapshots vkontakteIOS theme should match pseudo theme from CssVars 1`]
"spacingSizeS": "var(--vkui--spacing_size_s, 6px)",
"spacingSizeXl": "var(--vkui--spacing_size_xl, 12px)",
"spacingSizeXs": "var(--vkui--spacing_size_xs, 4px)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkBase)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkIOS)",
"themeName": "var(--vkui--theme_name, vkontakteIOS)",
"themeNameBase": "var(--vkui--theme_name_base, vkIOS)",
"themeNameBase": "var(--vkui--theme_name_base, vkontakteIOS)",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "var(--vkui--vkontakte_background_hover_alpha--active, rgba(0, 0, 0, 0.12))",
Expand Down Expand Up @@ -343240,9 +343247,9 @@ exports[`shapshots vkontakteIOS theme should match root theme snapshot 1`] = `
"spacingSizeS": 6,
"spacingSizeXl": 12,
"spacingSizeXs": 4,
"themeInheritsFrom": "vkBase",
"themeInheritsFrom": "vkIOS",
"themeName": "vkontakteIOS",
"themeNameBase": "vkIOS",
"themeNameBase": "vkontakteIOS",
"themeType": "root",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(0, 0, 0, 0.12)",
Expand Down Expand Up @@ -346525,15 +346532,15 @@ exports[`shapshots vkontakteIOSDark theme should match cssVars snapshot 1`] = `
},
"themeInheritsFrom": {
"name": "--vkui--theme_inherits_from",
"value": "var(--vkui--theme_inherits_from, vkBaseDark)",
"value": "var(--vkui--theme_inherits_from, vkIOS)",
},
"themeName": {
"name": "--vkui--theme_name",
"value": "var(--vkui--theme_name, vkontakteIOSDark)",
},
"themeNameBase": {
"name": "--vkui--theme_name_base",
"value": "var(--vkui--theme_name_base, vkIOS)",
"value": "var(--vkui--theme_name_base, vkontakteIOS)",
},
"themeType": "cssVars",
"vkontakteBackgroundHoverAlpha": {
Expand Down Expand Up @@ -348444,9 +348451,9 @@ exports[`shapshots vkontakteIOSDark theme should match pixelify theme snapshot 1
"spacingSizeS": "6px",
"spacingSizeXl": "12px",
"spacingSizeXs": "4px",
"themeInheritsFrom": "vkBaseDark",
"themeInheritsFrom": "vkIOS",
"themeName": "vkontakteIOSDark",
"themeNameBase": "vkIOS",
"themeNameBase": "vkontakteIOS",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(255, 255, 255, 0.12)",
Expand Down Expand Up @@ -349690,9 +349697,9 @@ exports[`shapshots vkontakteIOSDark theme should match pseudo theme from CssVars
"spacingSizeS": "var(--vkui--spacing_size_s, 6px)",
"spacingSizeXl": "var(--vkui--spacing_size_xl, 12px)",
"spacingSizeXs": "var(--vkui--spacing_size_xs, 4px)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkBaseDark)",
"themeInheritsFrom": "var(--vkui--theme_inherits_from, vkIOS)",
"themeName": "var(--vkui--theme_name, vkontakteIOSDark)",
"themeNameBase": "var(--vkui--theme_name_base, vkIOS)",
"themeNameBase": "var(--vkui--theme_name_base, vkontakteIOS)",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "var(--vkui--vkontakte_background_hover_alpha--active, rgba(255, 255, 255, 0.12))",
Expand Down Expand Up @@ -350936,9 +350943,9 @@ exports[`shapshots vkontakteIOSDark theme should match root theme snapshot 1`] =
"spacingSizeS": 6,
"spacingSizeXl": 12,
"spacingSizeXs": 4,
"themeInheritsFrom": "vkBaseDark",
"themeInheritsFrom": "vkIOS",
"themeName": "vkontakteIOSDark",
"themeNameBase": "vkIOS",
"themeNameBase": "vkontakteIOS",
"themeType": "root",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(255, 255, 255, 0.12)",
Expand Down
10 changes: 8 additions & 2 deletions src/themeDescriptions/themes/vkontakteAndroid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import type { ThemeVkontakteAndroidDarkDescription } from '@/interfaces/themes/v

import { darkTheme as vkDarkTheme, lightTheme as vkLightTheme } from '../../base/vk';

const themeNameBase = 'vkontakteAndroid';

export const vkontakteLocalColorLight: LocalVkontakteAndroidColorsDescriptionStruct = {
vkontakteColorSnippetBorderAlpha: 'rgba(0, 0, 0, 0.15)',
vkontakteColorSnippetBackground: '#FFFFFF',
Expand Down Expand Up @@ -232,7 +234,9 @@ export const vkontakteTokens = {

export const vkontakteAndroidTheme: ThemeVkontakteAndroidDescription = {
...vkLightTheme,
themeName: 'vkontakteAndroid',
themeName: themeNameBase,
themeNameBase,
themeInheritsFrom: vkLightTheme.themeName,

colors: {
...vkLightTheme.colors,
Expand All @@ -243,7 +247,9 @@ export const vkontakteAndroidTheme: ThemeVkontakteAndroidDescription = {

export const vkontakteAndroidThemeDark: ThemeVkontakteAndroidDarkDescription = {
...vkDarkTheme,
themeName: 'vkontakteAndroidDark',
themeName: `${themeNameBase}Dark`,
themeNameBase,
themeInheritsFrom: vkDarkTheme.themeName,
colorsScheme: 'dark',

colors: {
Expand Down
10 changes: 8 additions & 2 deletions src/themeDescriptions/themes/vkontakteCom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { ThemeVkontakteComDarkDescription } from '../../../interfaces/themes/vko
import { vkComTheme, vkComThemeDark } from '../vkCom';
import { vkontakteTokens } from '../vkontakteAndroid';

const themeNameBase = 'vkontakteCom';

const vkontakteComLocalColorLight: LocalVkontakteAndroidColorsDescriptionStruct = {
vkontakteColorSnippetBorderAlpha: 'rgba(0, 0, 0, 0.12)',
vkontakteColorSnippetBackground: '#FFFFFF',
Expand Down Expand Up @@ -188,7 +190,9 @@ const vkontakteComLocalColorDark: LocalVkontakteAndroidColorsDescriptionStruct =

export const vkontakteComTheme: ThemeVkontakteComDescription = {
...vkComTheme,
themeName: 'vkontakteCom',
themeName: themeNameBase,
themeNameBase,
themeInheritsFrom: vkComTheme.themeName,

colors: {
...vkComTheme.colors,
Expand All @@ -199,7 +203,9 @@ export const vkontakteComTheme: ThemeVkontakteComDescription = {

export const vkontakteComThemeDark: ThemeVkontakteComDarkDescription = {
...vkComThemeDark,
themeName: 'vkontakteComDark',
themeName: `${themeNameBase}Dark`,
themeNameBase,
themeInheritsFrom: vkComThemeDark.themeName,
colorsScheme: 'dark',

colors: {
Expand Down
Loading

0 comments on commit 13c61d3

Please sign in to comment.