luxbar icon indicating copy to clipboard operation
luxbar copied to clipboard

Why is the markup so redundantly verbose?

Open garretwilson opened this issue 5 years ago • 1 comments

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.

garretwilson avatar Aug 15 '18 18:08 garretwilson

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.

balzss avatar Dec 10 '18 13:12 balzss