Skip to content

Commit

Permalink
Merge pull request #571 from VKCOM/SevereCloud/fix/vkontakte/themeNam…
Browse files Browse the repository at this point in the history
…eBase

fix(vkontakte): themeNameBase
  • Loading branch information
Sarafa2n authored Aug 25, 2023
2 parents 651471b + f15d1ae commit 1613389
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 @@ -309992,13 +309992,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 @@ -311919,8 +311923,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 @@ -313174,8 +313179,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 @@ -314429,8 +314435,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 @@ -317741,15 +317748,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 @@ -319670,9 +319677,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 @@ -320926,9 +320933,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 @@ -322182,9 +322189,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 @@ -325495,15 +325502,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 @@ -327424,9 +327431,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 @@ -328680,9 +328687,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 @@ -329936,9 +329943,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 @@ -333249,15 +333256,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 @@ -335178,9 +335185,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 @@ -336434,9 +336441,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 @@ -337690,9 +337697,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 @@ -341003,15 +341010,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 @@ -342932,9 +342939,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 @@ -344188,9 +344195,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 @@ -345444,9 +345451,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 @@ -348757,15 +348764,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, vkIOSDark)",
},
"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 @@ -350686,9 +350693,9 @@ exports[`shapshots vkontakteIOSDark theme should match pixelify theme snapshot 1
"spacingSizeS": "6px",
"spacingSizeXl": "12px",
"spacingSizeXs": "4px",
"themeInheritsFrom": "vkBaseDark",
"themeInheritsFrom": "vkIOSDark",
"themeName": "vkontakteIOSDark",
"themeNameBase": "vkIOS",
"themeNameBase": "vkontakteIOS",
"themeType": "pixelify",
"vkontakteBackgroundHoverAlpha": {
"active": "rgba(255, 255, 255, 0.12)",
Expand Down Expand Up @@ -351942,9 +351949,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, vkIOSDark)",
"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 @@ -353198,9 +353205,9 @@ exports[`shapshots vkontakteIOSDark theme should match root theme snapshot 1`] =
"spacingSizeS": 6,
"spacingSizeXl": 12,
"spacingSizeXs": 4,
"themeInheritsFrom": "vkBaseDark",
"themeInheritsFrom": "vkIOSDark",
"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 1613389

Please sign in to comment.