Skip to content

Opacities Scale #863

@peduarte

Description

@peduarte

Is your feature request related to a problem? Please describe.
In Modulz, we're exposing Opacity Tokens, however:

Describe the solution you'd like
I'd like to be able to use the CSS function with an opacities scale:

css({
  opacity: 1 // should return 50%
})({
  theme: {
    opacities: ["0%", "50%", "100%"]
  }
})

Describe alternatives you've considered
The CSS function defaults to mapping to a scale named after the property. It's probably not intentional, @jxnblk would appreciate some context here.

Because of that, if we have a scale called opacity, it works:

css({
  opacity: 1 // should return 50%
})({
  theme: {
    opacity: ["0%", "50%", "100%"]
  }
})

Additional context
Here's a Codesandbox Demo with my expectation and workaround mentioned above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions