Skip to content

[RFC] Support prop aliases extensions #126

@kettanaito

Description

@kettanaito

What:

I propose to consider support of custom prop aliases (or aliases extensions).

Why:

  • To suit different projects' needs
  • To have more power with responsive props, while not violating the core principle of Atomic layout (if shipped by default)

How:

  • Developers can create a custom prop by using the exposed API on the Layout level:
import Layout from 'atomic-layout'

Layout.configure({
  propAliases: {
    textAlign: {
      output: ['text-align'],
      transformValue: optionalTransformer,
    }
  }
})
  • All custom prop aliases are responsive by default
  • Custom prop alias supports value transformer to be able to transform the supplied value

  • Put down an agreed API
  • Extend the Layout class
  • Expose default utils (i.e. transformNumeric) for developers to reuse the library's logic when writing custom aliases
  • Provide tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededneeds:discussionFurther information is requested

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions