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

plasma-new-hope: Refactoring tabs tokens, variations, config #873

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

nikewht
Copy link
Collaborator

@nikewht nikewht commented Nov 27, 2023

Tabs

  • вынесены токены в отдельный файл
  • исправлен конфиг
  • убрана вариация active

What/why changed

🐤 Download canary assets:
color
color_default_ios-swift--canary.873.7083023187.swift
color_default_kotlin--canary.873.7083023187.kt
color_default_react-native--canary.873.7083023187.ts
color_default_xml--canary.873.7083023187.xml
color_plasma_b2c_ios-swift--canary.873.7083023187.swift
color_plasma_b2c_kotlin--canary.873.7083023187.kt
color_plasma_b2c_react-native--canary.873.7083023187.ts
color_plasma_b2c_xml--canary.873.7083023187.xml
color_plasma_web_ios-swift--canary.873.7083023187.swift
color_plasma_web_kotlin--canary.873.7083023187.kt
color_plasma_web_react-native--canary.873.7083023187.ts
color_plasma_web_xml--canary.873.7083023187.xml
color_sberHealth_ios-swift--canary.873.7083023187.swift
color_sberHealth_kotlin--canary.873.7083023187.kt
color_sberHealth_react-native--canary.873.7083023187.ts
color_sberHealth_xml--canary.873.7083023187.xml
color_sbermarket_business_ios-swift--canary.873.7083023187.swift
color_sbermarket_business_kotlin--canary.873.7083023187.kt
color_sbermarket_business_react-native--canary.873.7083023187.ts
color_sbermarket_business_xml--canary.873.7083023187.xml
color_sbermarket_ios-swift--canary.873.7083023187.swift
color_sbermarket_kotlin--canary.873.7083023187.kt
color_sbermarket_metro_ios-swift--canary.873.7083023187.swift
color_sbermarket_metro_kotlin--canary.873.7083023187.kt
color_sbermarket_metro_react-native--canary.873.7083023187.ts
color_sbermarket_metro_xml--canary.873.7083023187.xml
color_sbermarket_react-native--canary.873.7083023187.ts
color_sbermarket_selgros_ios-swift--canary.873.7083023187.swift
color_sbermarket_selgros_kotlin--canary.873.7083023187.kt
color_sbermarket_selgros_react-native--canary.873.7083023187.ts
color_sbermarket_selgros_xml--canary.873.7083023187.xml
color_sbermarket_wlbusiness_ios-swift--canary.873.7083023187.swift
color_sbermarket_wlbusiness_kotlin--canary.873.7083023187.kt
color_sbermarket_wlbusiness_react-native--canary.873.7083023187.ts
color_sbermarket_wlbusiness_xml--canary.873.7083023187.xml
color_sbermarket_xml--canary.873.7083023187.xml
color_sberonline_ios-swift--canary.873.7083023187.swift
color_sberonline_kotlin--canary.873.7083023187.kt
color_sberonline_react-native--canary.873.7083023187.ts
color_sberonline_xml--canary.873.7083023187.xml
color_sberprime_ios-swift--canary.873.7083023187.swift
color_sberprime_kotlin--canary.873.7083023187.kt
color_sberprime_react-native--canary.873.7083023187.ts
color_sberprime_xml--canary.873.7083023187.xml
color_stylesSalute_ios-swift--canary.873.7083023187.swift
color_stylesSalute_kotlin--canary.873.7083023187.kt
color_stylesSalute_react-native--canary.873.7083023187.ts
color_stylesSalute_xml--canary.873.7083023187.xml
shadow
shadow_default_react-native--canary.873.7083023187.ts
shadow_plasma_b2c_react-native--canary.873.7083023187.ts
shadow_plasma_web_react-native--canary.873.7083023187.ts
shadow_sberHealth_react-native--canary.873.7083023187.ts
shadow_sbermarket_business_react-native--canary.873.7083023187.ts
shadow_sbermarket_metro_react-native--canary.873.7083023187.ts
shadow_sbermarket_react-native--canary.873.7083023187.ts
shadow_sbermarket_selgros_react-native--canary.873.7083023187.ts
shadow_sbermarket_wlbusiness_react-native--canary.873.7083023187.ts
shadow_sberonline_react-native--canary.873.7083023187.ts
shadow_sberprime_react-native--canary.873.7083023187.ts
shadow_stylesSalute_react-native--canary.873.7083023187.ts
borderRadius
borderRadius_default_react-native--canary.873.7083023187.ts
borderRadius_plasma_b2c_react-native--canary.873.7083023187.ts
borderRadius_plasma_web_react-native--canary.873.7083023187.ts
borderRadius_sberHealth_react-native--canary.873.7083023187.ts
borderRadius_sbermarket_business_react-native--canary.873.7083023187.ts
borderRadius_sbermarket_metro_react-native--canary.873.7083023187.ts
borderRadius_sbermarket_react-native--canary.873.7083023187.ts
borderRadius_sbermarket_selgros_react-native--canary.873.7083023187.ts
borderRadius_sbermarket_wlbusiness_react-native--canary.873.7083023187.ts
borderRadius_sberonline_react-native--canary.873.7083023187.ts
borderRadius_sberprime_react-native--canary.873.7083023187.ts
borderRadius_stylesSalute_react-native--canary.873.7083023187.ts
spacing
spacing_default_react-native--canary.873.7083023187.ts
spacing_plasma_b2c_react-native--canary.873.7083023187.ts
spacing_plasma_web_react-native--canary.873.7083023187.ts
spacing_sberHealth_react-native--canary.873.7083023187.ts
spacing_sbermarket_business_react-native--canary.873.7083023187.ts
spacing_sbermarket_metro_react-native--canary.873.7083023187.ts
spacing_sbermarket_react-native--canary.873.7083023187.ts
spacing_sbermarket_selgros_react-native--canary.873.7083023187.ts
spacing_sbermarket_wlbusiness_react-native--canary.873.7083023187.ts
spacing_sberonline_react-native--canary.873.7083023187.ts
spacing_sberprime_react-native--canary.873.7083023187.ts
spacing_stylesSalute_react-native--canary.873.7083023187.ts
typo
typo_mage_ios-swift--canary.873.7083023187.swift
typo_mage_kotlin--canary.873.7083023187.kt
typo_mage_react-native--canary.873.7083023187.ts
typo_plasma_ios-swift--canary.873.7083023187.swift
typo_plasma_kotlin--canary.873.7083023187.kt
typo_plasma_react-native--canary.873.7083023187.ts
typo_ruler_ios-swift--canary.873.7083023187.swift
typo_ruler_kotlin--canary.873.7083023187.kt
typo_ruler_react-native--canary.873.7083023187.ts
typo_sage_ios-swift--canary.873.7083023187.swift
typo_sage_kotlin--canary.873.7083023187.kt
typo_sage_react-native--canary.873.7083023187.ts
typo_sbermarket_ios-swift--canary.873.7083023187.swift
typo_sbermarket_kotlin--canary.873.7083023187.kt
typo_sbermarket_react-native--canary.873.7083023187.ts
typo_soulmate_ios-swift--canary.873.7083023187.swift
typo_soulmate_kotlin--canary.873.7083023187.kt
typo_soulmate_react-native--canary.873.7083023187.ts
📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
# or 
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]

@Salute-Eva
Copy link
Contributor

Theme Builder app deployed!

http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-873/

@Salute-Eva
Copy link
Contributor

--plasma-tabs-color: var(--text-primary);
--plasma-tabs-color-hover: var(--text-primary);
--plasma-tabs-font-color: var(--text-primary);
--plasma-tabs-font-color-hover: var(--text-primary);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а можешь, пожалуйста, токены, которые ты вынес в отдельный файл перенести и сюда тоже?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправил

@@ -12,22 +12,22 @@ export const config = {
--plasma-tabs-underline-color: var(--surface-solid-tertiary);
--plasma-tabs-underline-height: 2px;
--plasma-tabs-font-weight: 500;
--plasma-tabs-color: var(--text-accent);
--plasma-tabs-font-color: var(--text-accent);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не критично

кажется, что не обязательно добавлять font, т.к. именно для фона какого-то элемента (в данном случае таба) используется свойство background, и выглядело бы оно тогда --plasma-tabs-background

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправил

fontWeight: '--plasma-tabs-font-weight',
fontColor: '--plasma-tabs-font-color',
fontColorHover: '--plasma-tabs-font-color-hover',
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а вообще подумал, что лучше эти токены перенести в общий файлик - Tabs.tokens и забирать из одного места во всех компонентах

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправил

@Salute-Eva
Copy link
Contributor

Theme Builder app deployed!

http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-873/

@Salute-Eva
Copy link
Contributor

--plasma-tabs-cursor: pointer;
--plasma-tabs-color-hover: var(--text-primary);
${tokens.underlineColor}: var(--surface-solid-tertiary);
${tokens.underlineHeight}: 2px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

переведи в rem пожалуста

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправил

import { css } from '@linaria/core';

import { tokens } from '../../../../components/Tabs/TabItem.tokens';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

здесь лучше забрать токены из индекса, по аналогии с Dropdown:

import { dropdownTokens } from '../../../../../components/Dropdown';

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправил

@@ -1 +1,2 @@
export { tabsRoot, tabsConfig } from './Tabs';
export { tabItemRoot, tabItemConfig } from './TabItem';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут ещё нужно добавить ре-экспорт токенов

export { classes as dropdownClasses, tokens as dropdownTokens } from './Dropdown.tokens';

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поправил

:hover {
cursor: var(${tokens.cursor});
}
`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется, что это должно быть не в disabled? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Удалил по аналогии с active

@@ -0,0 +1,4 @@
export const tokens = {
disabledOpacity: '--plasma-tabs-disabled-opacity',
containerWidth: '--plasma-tabs-container-width',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вот сюда добавить токены из TabsItem, имел ввиду

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перенес

@Salute-Eva
Copy link
Contributor

Theme Builder app deployed!

http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-873/

@Salute-Eva
Copy link
Contributor

@Yeti-or
Copy link
Contributor

Yeti-or commented Dec 4, 2023

🎱

@nikewht nikewht added this pull request to the merge queue Dec 4, 2023
Merged via the queue into dev with commit f17b825 Dec 4, 2023
24 checks passed
@nikewht nikewht deleted the nikewht.new-hope.tabs branch December 4, 2023 07:53
This was referenced Dec 13, 2023
@Yakutoc Yakutoc changed the title refactor(new-hope): Tabs tokens, variations, config plasma-new-hope: Refactoring tabs tokens, variations, config Dec 13, 2023
@Salute-Eva
Copy link
Contributor

🚀 This PR is included in version: @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected], @salutejs/[email protected] 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants