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-4660: feat(plasma-b2c, plasma-web): Add applyPaper mixin #1828

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

neretin-trike
Copy link
Collaborator

@neretin-trike neretin-trike commented Mar 10, 2025

PLASMA-WEB

applyPaper

  • Добавлен миксин applyPaper, который позволяет создать базовый стиль подложки для любого блока, со следующим набором свойств, значения которых доступны из темы plasma_web:
    • backgroundColor - отвечает за цвет подложки в котором можно выбрать токены цветов и градиентов;
    • borderRadius - отвечает за скругление углов блока;
    • shadow - отвечает за применение стилей теней для блока;
    • styles - отвечает за все доступные css свойства.

Например:

        <div
            style={applyPaper({
                backgroundColor: 'surfaceAccent',
                borderRadius: 'borderRadiusM',
                shadow: 'shadowDownHardM',
                styles: {
                    color: 'white',
                    width: '10rem',
                    height: '10rem',
                },
            })}
        >
            Test card
        </div>

PLASMA-B2C

applyPaper

  • Добавлен миксин applyPaper, который позволяет создать базовый стиль подложки для любого блока, со следующим набором свойств, значения которых доступны из темы plasma_b2c:
    • backgroundColor - отвечает за цвет подложки в котором можно выбрать токены цветов и градиентов;
    • borderRadius - отвечает за скругление углов блока;
    • shadow - отвечает за применение стилей теней для блока;
    • styles - отвечает за все доступные css свойства.

Например:

        <div
            style={applyPaper({
                backgroundColor: 'surfaceAccent',
                borderRadius: 'borderRadiusM',
                shadow: 'shadowDownHardM',
                styles: {
                    color: 'white',
                    width: '10rem',
                    height: '10rem',
                },
            })}
        >
            Test card
        </div>

What/why changed

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

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

Copy link
Contributor

Theme Builder app deployed!

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

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.

1 participant