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

Recommend the use of Less namespaces for extensions #322

Open
davwheat opened this issue Apr 29, 2021 · 0 comments
Open

Recommend the use of Less namespaces for extensions #322

davwheat opened this issue Apr 29, 2021 · 0 comments

Comments

@davwheat
Copy link
Member

davwheat commented Apr 29, 2021

To prevent any mixin collisions between extensions, we should recommend the use of Less namespaces, similar to how we handle initiali(s/z)ers in JS.

https://lesscss.org/features/#mixins-feature-namespaces

They're not that tricky to understand, thankfully, using an ID-based system.

My suggested syntax would be #vendor__package. I don't know how Less would handle slashes, etc.

#davwheat__sidebar-nav-items {
  .my-cool-mixin() {
    color: red;
  }
}

button.davwheat_btn {
  #davwheat__sidebar-nav-items.my-cool-mixin();
}

Eventually, core should switch to something like #flarum__core.xxx(), or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant