Closed MartijnCuppens closed 5 years ago
While this might be a good idea for advanced usages, the classes here should be exactly what they are upstream, at least by default.
On Sat, Sep 29, 2018, 11:13 Martijn Cuppens notifications@github.com wrote:
In my own projects I always add a js- prefix to classes of element where javascript is applied to. By using js- prefix for classes in DOM elements you decouple functional aspects of these elements from CSS ones. An example:
This has some advantages:
- as css coder, you can easily change anchor design by changing btn class and not worry it'll break pop up behavior.
- and conversely, as JavaScript developer you can remove popup behavior and never break any existing CSS rules.
(source: https://coderwall.com/p/qktuzw/decouple-javascript-classes-from-css-ones-by-using-prefix, this just perfectly described what I meant)
What do you thing @Johann-S https://github.com/Johann-S, @XhmikosR https://github.com/XhmikosR?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Johann-S/bs-customizer/issues/40, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVVtTbrLF5so9i5kGso549Lpf07B66eks5ufyuagaJpZM4XAZSs .
the classes here should be exactly what they are upstream, at least by default.
Can you clarify this a bit more?
It seems a good idea to me 👍
Wait, you mean add the ability to specify an optional prefix?
Or you meant this for the customizer's own code?
@XhmikosR, the customizer's code, didn't realise this wasn't clear untill I read your comment 😀
Ah, OK then :)
Haha, the good first issue tag, thanks @Johann-S! I'll have a look at this 🙂
In my own projects I always add a
js-
prefix to classes of element where javascript is applied to. By usingjs-
prefix for classes in DOM elements you decouple functional aspects of these elements from CSS ones. An example:This has some advantages:
(source: https://coderwall.com/p/qktuzw/decouple-javascript-classes-from-css-ones-by-using-prefix, this just perfectly described what I meant)
What do you think @Johann-S, @XhmikosR?