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

Typography: Define typography styles for each component in their theme schemas #366

Open
simeonoff opened this issue Dec 6, 2024 · 0 comments · May be fixed by #377
Open

Typography: Define typography styles for each component in their theme schemas #366

simeonoff opened this issue Dec 6, 2024 · 0 comments · May be fixed by #377
Assignees
Labels
schemas ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@simeonoff
Copy link
Contributor

simeonoff commented Dec 6, 2024

Currently, both Ignite UI for Angular and Ignite UI for Web Components try to mirror one another's typography. Let's move the typography categories for each component into the design token schemas.

For example in Angular we have this for the card component:

@mixin card-typography($categories: (
    title: 'h6',
    title-small: 'subtitle-2',
    subtitle: 'subtitle-2',
    content: 'body-2')
) {
    $title: map.get($categories, 'title');
    $title-small: map.get($categories, 'title-small');
    $subtitle: map.get($categories, 'subtitle');
    $content: map.get($categories, 'content');

    %igx-card-header-title {
        @include type-style($title) {
            margin: 0;
        }
    }

    %igx-card-header-title--small {
        @include type-style($title-small) {
            margin: 0;
        }
    }

    %igx-card-header-subtitle {
        @include type-style($subtitle){
            margin: 0;
        }
    }

    %igx-card-content > *:not(igx-icon) {
        @include type-style($content) {
            margin: 0;
        }
    }
}

The mixin above has default category values for the Material theme. These values can differ from theme to theme, but the categories remain the same.

This is how the updated card material schema will look like with the typography tokens included:

$light-card: extend(
    $default-elevation-card,
    (
        ... other props,

        typography: (
            title: (
                large: (
                    value: 'h6',
                ),
                small: (
                    value: 'subtitle-2',
                ),
            ),
            subtitle: (
                value: 'subtitle-2',
            ),
            content: (
                value: 'body-2',
            ),
        )
    )
);

@simeonoff simeonoff self-assigned this Dec 6, 2024
@simeonoff simeonoff assigned didimmova and unassigned simeonoff Jan 22, 2025
@didimmova didimmova added the 🛠️ status: in-development Issues and PRs with active development on them label Jan 24, 2025
@didimmova didimmova added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schemas ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants