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

indirect styles for padding (or anything?) rejected #106

Open
wkeese opened this issue Nov 23, 2023 · 3 comments
Open

indirect styles for padding (or anything?) rejected #106

wkeese opened this issue Nov 23, 2023 · 3 comments

Comments

@wkeese
Copy link

wkeese commented Nov 23, 2023

This works fine with no lint errors:

.foo {
  padding: spacing.$spacing-04 spacing.$spacing-05;
}

However, this fails:

$container-padding: spacing.$spacing-04 spacing.$spacing-05;
.foo {
  padding: $container-padding;
}

Is it possible to support both (without throwing an error)?

@lee-chase
Copy link
Member

This is tricky and requires a bit of thought because of how local variables are being handled.

Not sure if this is a problem that goes away if I switch to using the postcss processor. Probably worth doing that first rather than updating the existing parsing.

@wkeese
Copy link
Author

wkeese commented May 4, 2024

A postcss processor is an interesting idea, although for layout variables IIRC it converts them to raw values? It used to use CSS variables but I think you discontinued that, so that (at least with some configurations) it converts

padding: spacing.$spacing-05

into

padding: 1rem

(or something like that). In which case, the stylelint wouldn't be able to do its job.

@lee-chase
Copy link
Member

@wkeese I meant to refer to the postcss value parser, which I think just produces a tree from the value.

Either way, with regards to this issue, it is not a quick fix due to the way the SCSS values are currently being processed.

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

No branches or pull requests

2 participants