Skip to content

Conversation

@neretin-trike
Copy link
Collaborator

@neretin-trike neretin-trike commented May 20, 2025

Core

  • Добавлена поддержка "инвариантных" стилей, которые применяются к компоненту в независимости от выбранной вариации.

Пример конфига:

{
    ...,
    invariants: css`
        ${iconButtonTokens.iconButtonDisabledOpacity}: 0.4;
        ${iconButtonTokens.iconButtonFocusColor}: var(--surface-accent);
    `,
}

What/why changed

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @salutejs/plasma-asdk@0.355.0-canary.1983.19295272379.0
npm install @salutejs/plasma-b2c@1.597.0-canary.1983.19295272379.0
npm install @salutejs/plasma-giga@0.324.0-canary.1983.19295272379.0
npm install @salutejs/plasma-new-hope@0.341.0-canary.1983.19295272379.0
npm install @salutejs/plasma-web@1.599.0-canary.1983.19295272379.0
npm install @salutejs/sdds-bizcom@0.329.0-canary.1983.19295272379.0
npm install @salutejs/sdds-crm@0.328.0-canary.1983.19295272379.0
npm install @salutejs/sdds-cs@0.333.0-canary.1983.19295272379.0
npm install @salutejs/sdds-dfa@0.327.0-canary.1983.19295272379.0
npm install @salutejs/sdds-finai@0.320.0-canary.1983.19295272379.0
npm install @salutejs/sdds-insol@0.324.0-canary.1983.19295272379.0
npm install @salutejs/sdds-netology@0.328.0-canary.1983.19295272379.0
npm install @salutejs/sdds-scan@0.327.0-canary.1983.19295272379.0
npm install @salutejs/sdds-serv@0.328.0-canary.1983.19295272379.0
# or 
yarn add @salutejs/plasma-asdk@0.355.0-canary.1983.19295272379.0
yarn add @salutejs/plasma-b2c@1.597.0-canary.1983.19295272379.0
yarn add @salutejs/plasma-giga@0.324.0-canary.1983.19295272379.0
yarn add @salutejs/plasma-new-hope@0.341.0-canary.1983.19295272379.0
yarn add @salutejs/plasma-web@1.599.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-bizcom@0.329.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-crm@0.328.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-cs@0.333.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-dfa@0.327.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-finai@0.320.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-insol@0.324.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-netology@0.328.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-scan@0.327.0-canary.1983.19295272379.0
yarn add @salutejs/sdds-serv@0.328.0-canary.1983.19295272379.0

@github-actions
Copy link
Contributor

Theme Builder app deployed!

https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1983/

@github-actions
Copy link
Contributor

github-actions bot commented May 20, 2025

Copy link
Contributor

@Yeti-or Yeti-or left a comment

Choose a reason for hiding this comment

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

В этом пр надо поправить код компонента: 9a29959#r157471608 а смотреть как это будет работать в реальном Button мы не будем ?

${({ staticVariants }) => staticVariants};
${({ dynamicVariants }) => dynamicVariants};
${({ intersectionStyles }) => intersectionStyles};
${({ invariants }) => invariants};
Copy link
Contributor

Choose a reason for hiding this comment

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

вопрос такой если я напишу в варицаии disableOpacity отличающийся от того что написано в инварианте, кто победит?

Copy link
Collaborator Author

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.

А как мы определяем порядок кто должен быть первым и последним?

@neretin-trike
Copy link
Collaborator Author

В этом пр надо поправить код компонента: 9a29959#r157471608 а смотреть как это будет работать в реальном Button мы не будем ?

да, надо будет убрать комменты. Ну я бы пока не хотел менять в реальных компонентах это. Но предлагаю делать точечно, когда появится необходимость при генерации

@neretin-trike neretin-trike force-pushed the neretinaa/add-invariants-support branch from 73416bb to 97ab015 Compare May 30, 2025 09:02
@neretin-trike neretin-trike force-pushed the neretinaa/add-invariants-support branch from 97ab015 to 85fe43f Compare June 6, 2025 07:28
@neretin-trike neretin-trike force-pushed the neretinaa/add-invariants-support branch from 85fe43f to d6645ad Compare June 6, 2025 08:40
@neretin-trike neretin-trike marked this pull request as draft June 6, 2025 08:45
@neretin-trike neretin-trike force-pushed the neretinaa/add-invariants-support branch from d6645ad to b0c9494 Compare June 19, 2025 11:57
@neretin-trike neretin-trike force-pushed the neretinaa/add-invariants-support branch from b0c9494 to 27eb653 Compare June 19, 2025 12:24
@Yakutoc Yakutoc changed the title feat(plasma-new-hope): Add invariants support feat(plasma-new-hope): Add invariants support [DONT MERGE] Jun 25, 2025
@neretin-trike neretin-trike force-pushed the neretinaa/add-invariants-support branch from 27eb653 to 909acc3 Compare June 26, 2025 08:31
@neretin-trike neretin-trike force-pushed the neretinaa/add-invariants-support branch from 909acc3 to b42df10 Compare November 12, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants