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

Feature to reference current selector rules config #318

Open
gavinmcfarland opened this issue Jan 9, 2018 · 0 comments
Open

Feature to reference current selector rules config #318

gavinmcfarland opened this issue Jan 9, 2018 · 0 comments
Labels
enhancement package/atomizer Issues for atomizer package

Comments

@gavinmcfarland
Copy link

gavinmcfarland commented Jan 9, 2018

It would be useful to be able to reference the matching class name in the current rule. Currently you have to define this manually which is normally ok, but when the class name has parameters and you need it to scope to that class name only, there is no way to do this (that I can tell).

Example:

{
        "type": "pattern",
        "id": "guttering",
        "name": "Guttering",
        "matcher": "Gt",
        "allowParamToValue": true,
        "styles": {
            "margin-right": "calc($0 - ($0 * 2))",
	    "margin-bottom": "calc($0 - ($0 * 2))"
        },
        "rules": {
            "$selector > *": {
                "margin-right": "$0",
                "margin-bottom": "$0"
            }
        }
 }

Would output:

.Gt\(20px\) {
  margin-right: calc(20px - (20px * 2));
  margin-bottom: calc(20px - (20px * 2));
}
.Gt\(20px\) > * {
  margin-right: 20px;
  margin-bottom: 20px;
}
@redonkulus redonkulus added the package/atomizer Issues for atomizer package label Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement package/atomizer Issues for atomizer package
Projects
None yet
Development

No branches or pull requests

2 participants