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: Return callback with scoped namespace and/or block #30

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

#bem: Return callback with scoped namespace and/or block #30

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

Note: microsoft/TypeScript#12265 (comment)
Related: #41

namespace

TS parser should know somehow. Same JS understand from object in case of mix

https://material.io/components/buttons/web#contained-button

<i class="material-icons mdc-button__icon" aria-hidden="true">bookmark</i>

block

https://material.io/components/buttons/web#contained-button

<button class="mdc-button mdc-button--raised mdc-ripple-upgraded mdc-ripple-upgraded--foreground-activation">
  <span class="mdc-button__ripple"></span>
  <i class="material-icons mdc-button__icon">bookmark</i>
  <span class="mdc-button__label">Contained Button plus Icon</span>
</button>

turns to something like

ctx from string

const btn = bem("mdc-button") // (["mdc", "button"]) ? "@mdc"? "mdc"? + vs `bem("mdc")` vs `bem("button")

<button {...btn(true, {$: "raised"}, {"mdc-ripple-upgraded": "foreground-activation"})}>
  <i {...btn({icon: true}, materialIcon)}/>
  {/* button of button */}
  <I {...btn(true, {$: "raised", icon: true}, materialIcon)}/>
</button>

ctx from separated singleton of block

const btn = bem({"mdc-button": "raised"}, {"mdc-ripple-upgraded": "foreground-activation"})

<button {...btn}>
  <i {...btn(true, {$: "raised", icon: true}, materialIcon)}/>
</button>
@askirmas askirmas self-assigned this Mar 11, 2021
@askirmas askirmas added the enhancement New feature or request label Mar 11, 2021
@askirmas askirmas added this to the v0.16 milestone Mar 11, 2021
@askirmas askirmas changed the title bem: scope block #bem: Return callback with scoped block Mar 11, 2021
@askirmas askirmas changed the title #bem: Return callback with scoped block #bem: Return callback with scoped block Mar 11, 2021
@askirmas askirmas changed the title #bem: Return callback with scoped block #bem: Return callback with scoped namespace and/or block Mar 11, 2021
@askirmas askirmas modified the milestones: v0.16, v0.17 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