luxbar
luxbar copied to clipboard
Why is the markup so redundantly verbose?
Your library looks very promising. I like the idea of a navigation bar I can plug into my site without being forced to use a bloated framework.
But one of the problems I have with some of the frameworks is that they are so verbose. It's not enough to say that something is a <button>
; you have to say <button class="btn">
as the the element name weren't enough. It adds more cruft to the document for no reason.
I'm surprised that luxbar does the same thing. If I have a <div>
, I understand that I need to use <div class="luxbar">
. That's understandable. But if I have a <ul class="luxbar-navigation">
, why must I use <li class="luxbar-item">
for each item? Shouldn't each <li>
be a luxbar item by default? To me that's redundant.
I understand that there are other options such as <li class="luxbar-header">
, but the CSS should be able to make the "luxbar-item
" style the default.
Look at the example on the main page:
…
<li class="luxbar-item dropdown"><a href="#">Users</a>
<ul>
<li class="luxbar-item" ><a href="#">Max</a></li>
<li class="luxbar-item" ><a href="#">Edgar</a></li>
<li class="luxbar-item" ><a href="#">John</a></li>
</ul>
</li>
Why?! So much redundancy. Why can't I do this?
…
<li class="dropdown"><a href="#">Users</a>
<ul>
<li><a href="#">Max</a></li>
<li><a href="#">Edgar</a></li>
<li><a href="#">John</a></li>
</ul>
</li>
After all, the first <li>
this example is itself in a luxbar navigation, so even it doesn't need a luxbar-item
.
Sorry for the later reply and thanks for sharing your ideas/opinion. I totally agree with you on this. Luxbar hasn't been updated since May, 2017 so I really need to get on this and do a major version update. I have new ideas to implement and issues (like what you mentioned) to solve so thanks again for the feedback and stay tuned for the version update.
I will leave this issue open until the rewrite happens.