Skip to content

Allow hyphen (-) on pattern id #243

@gambry

Description

@gambry

I'm experimenting with defining a consistent way of loading pattern across different platform. For this reason I've built gambry/pattern-twig-extension which provide a pattern() twig function wrapping include + dispatching events developers can subscribe too.

This function is heavely influenced by UI Patterns, and for this reason you don't require this package on Drupal as using this contrib is the recommended way.

The issue I'm currently having is PatternLab (as well as Fractal I believe) silently suggests to use hyphens - and not underscores - when naming multiwords patterns, i.e. button-icon rather than button_icon.

So I can use pattern('button-text) anywhere - through the library - BUT in Drupal - through UI Patterns Pattern Lab - because UI Pattern doesn't allow hyphens in pattern ID.

I went through this issue queue to find clue about this when I spotted this comment:

maybe we can convert - into _ or allow it and see how the Drupal theme system reacts to that

So I'm raising this question now: why don't we allow hyphens as Pattern ID machine name?

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