mincho-js / mincho

Natural CSS in TypeScript
MIT License
35 stars 0 forks source link

Implement property reference #46

Open black7375 opened 2 months ago

black7375 commented 2 months ago

Is your feature request related to a problem?

https://github.com/mincho-js/working-group/blob/main/text/001-css-nesting.md#6-property-reference

The solution I'd like

A property for property reference is added to the context, and should be referenced.

Screenshots or video

No response

Alternatives I've considered

No response

Additional context

No response

black7375 commented 1 month ago

We've decided not to support the following cases yet. However, if you are providing support for complex cases, you will most likely use the format "@{CUSTOM_PROPERTY}".

transformStyle({
  background: {
    "@media (prefers-reduced-motion)": "red",
    _hover: "@{@media (prefers-reduced-motion)}",

    "nav li > &": "blue",
    _active: "@{nav li > &}"
  }
})