flarum / flarum/docs

Recommend the use of Less namespaces for extensions

Open
#322 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
77
Forks
134
Avg merge
19m
Merged PRs (30d)
9

Description

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.

```less
#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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.