Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BEM multi-word convention for Element or Modifier classes #836

Merged
merged 1 commit into from
Jul 17, 2019

Conversation

simurai
Copy link
Contributor

@simurai simurai commented Jul 17, 2019

This came up in #834 (comment).

Current

When a Block class requires two words use PascalCase, for example ProgressBar.

But we don't have a convention when Element or Modifier classes require two (or more) words.

Proposal

When an Element or Modifier class requires two words use camelCase, for example [Component]-closeButton or [Component]--extraLarge.

Alternatives

An alternative would be to use a - dash, like [Component]-close-button or [Component]--extra-large. But that might look like there are multiple nested elements. Or a modifier that has a unique child element. camelCase makes it more clear that the two words belong together.

/cc @primer/ds-core

in Element and Modifier classes.
@vercel
Copy link

vercel bot commented Jul 17, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@shawnbot shawnbot changed the base branch from master to release-12.5.0 July 17, 2019 20:24
Copy link
Contributor

@shawnbot shawnbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👨‍⚖️

@shawnbot shawnbot merged commit cf831ad into release-12.5.0 Jul 17, 2019
@shawnbot shawnbot deleted the bem-multi-word branch July 17, 2019 20:25
@simurai simurai mentioned this pull request Jul 17, 2019
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants