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

💖 Shorthand rules automatically inherit related rule variables #330

Open
1aron opened this issue Feb 22, 2024 · 0 comments
Open

💖 Shorthand rules automatically inherit related rule variables #330

1aron opened this issue Feb 22, 2024 · 0 comments

Comments

@1aron
Copy link
Member

1aron commented Feb 22, 2024

Current

config.variables

{
        'font-family': {
            sans: ['InterVariable', 'Noto Sans TC', ...variables['font-family'].sans],
            mono: ['Fira Code', ...variables['font-family'].mono]
        },
        'font-feature-settings': {
            sans: "'cv06', 'cv10', 'cv11', 'cv12', 'cv13'"
        }
}

config.rules

{
    font: {
        match: /^f:/,
        layer: Layer.CoreNativeShorthand,
        variables: [
            'font-family',
            'font-variant',
            'font-weight',
            'font-size',
            'font-style',
            'line-height'
        ]
    } as RuleDefinition,
}

Expected

config.rules

{
    font: {
        match: /^f:/,
        layer: Layer.CoreNativeShorthand,
-       variables: [
-           'font-family',
-           'font-variant',
-           'font-weight',
-           'font-size',
-           'font-style',
-           'line-height'
-       ]
    } as RuleDefinition,
}

Inherits variables from any non-shorthand rule matching --font-.*.

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

No branches or pull requests

1 participant