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 Root-key (base) can be "b__e" and treat undefined as true #39

Closed
askirmas opened this issue Mar 11, 2021 · 0 comments
Closed

#bem Root-key (base) can be "b__e" and treat undefined as true #39

askirmas opened this issue Mar 11, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@askirmas
Copy link
Owner

askirmas commented Mar 11, 2021

Related: #30
For verbosity

const icon = {"material-icons": true} as const
const ripple = "mdc-ripple-upgraded" as const
const {button__icon, button__ripple, button__lable} = {} as MyClassNames

<button {...bem({button: "raised", [ripple]: "background-focused"})}>
  <span  {...bem({button__ripple})}/>
  <i  {...bem({button__icon, ...icon})}>bookmark</i>
  <span  {...bem({button__label})}>Contained Button plus Icon</span>
</button>

Thus becomes similar to naming

classnames[R]? value naming bem
- undefined R ?R
+ undefined C ?C
- false ? R | delete R ? R | delete R
+ false ? C | delete R ? C | delete R
- true R R
+ true C C
- string value R R--value
+ string !R, value | C | Error C C--value
- null ?delete R ?delete R
+ null ?delete R ?delete R
- primitive[] ? R R--value?
+ primitive[] ? C C--value?
- {[k]: string} ? R R--key--val
+ {[k]: boolean} ? C C--key?
@askirmas askirmas added the question Further information is requested label Mar 11, 2021
@askirmas askirmas self-assigned this Mar 11, 2021
@askirmas askirmas added enhancement New feature or request and removed question Further information is requested labels Mar 12, 2021
@askirmas askirmas added this to the v0.16 milestone Mar 12, 2021
@askirmas askirmas changed the title #bem Consider using "b__e" at root and treat undefined as true #bem Root-key (base) can be "b__e" at root and treat undefined as true Mar 12, 2021
@askirmas askirmas changed the title #bem Root-key (base) can be "b__e" at root and treat undefined as true #bem Root-key (base) can be "b__e" and treat undefined as true Mar 12, 2021
askirmas pushed a commit that referenced this issue Mar 12, 2021
askirmas pushed a commit that referenced this issue Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant