Skip to content

Feature to reference current selector rules config #318

Open
@gavinmcfarland

Description

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;
}

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions