Skip to content

Support array for css definition #386

Description

@johannes-z

This could be helpful, if you have a style definition like the following. Right now I had to create function that merges all objects in the array:

const styles = {
    root: [
      {
        display: 'inline',
      },
      (nowrap || block) && {
        display: 'block',
      },
      nowrap && {
        whiteSpace: 'nowrap',
        overflow: 'hidden',
        textOverflow: 'ellipsis',
      },
    ],
  }

Additionally, when implementing this syntax, aphrodite could also support string values for base-classes that are only used for markers, i.e.:

const styles = {
  root: [
    'namespace-Component',
    {
      display: 'block'
    }
  ]
}

css(StyleSheet.create(styles).root)would result in namespace-Component root_HASH.

Let me know what you think!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions