GithubHelp home page GithubHelp logo

Comments (11)

claviska avatar claviska commented on May 8, 2024 21

I've been a Bootstrap user for years. I still use it in some projects. In my experience, I've never used a <table> without <table class="table">. It's redundant. They're not custom components, they're just elements such as headings, links, etc. The latter are styled by default (in Bootstrap too), so why not other elements?

I've also never used an input in Bootstrap without <input class="form-control">. Why would one want styled inputs on one part of the page and unstyled inputs elsewhere?

If the answer is "because it makes it easier to style myself" then I could argue that it actually makes it harder. Shoelace provides a minimal reset that makes it much easier to override its default styles than starting entirely from scratch.

All in all, Shoelace !== Bootstrap. It's a forward thinking experiment that may break paradigms here and there :)

from shoelace.

evansd avatar evansd commented on May 8, 2024 1

Bootstrap made this change so that you could use external JavaScript widgets on the page without the default styles trashing their layout. In particular the default table classes caused problems with the jQuery UI DatePicker widget, and apparently the default form styles were also problematic.

from shoelace.

pkill37 avatar pkill37 commented on May 8, 2024

In my experience, I've never used a <table>, for example, without <table class="table">. It's redundant. They're not custom components, they're just elements such as headings, links, etc. The latter are styled by default (in Bootstrap too), so why not other elements?

I actually quite like this argument. Never thought about it that way, but it makes a lot of sense, especially considering Shoelace's general philosophy.

from shoelace.

pkill37 avatar pkill37 commented on May 8, 2024

Note that Bootstrap v1 automatically styled tables as well.

http://bootstrapdocs.com/v1.4.0/docs/#tables

Might be interesting to understand why they changed that.

from shoelace.

claviska avatar claviska commented on May 8, 2024

I'd be interested to know that to. I assume it was to please people who used tables for non-table purposes (which is IMO not a good reason).

from shoelace.

claviska avatar claviska commented on May 8, 2024

Thanks for the links. I think that made sense five years ago, but it's less relevant these days. πŸ˜„

I know some people will disagree with my decision, and I realize some third-party controls may still utilize tables [incorrectly] as layout devices. I'm OK with a style collision here and there (although I haven't run into any yet). Until we have custom elements to provide better namespacing, these things will continue to happen no matter how hard to try to avoid it.

I prefer convenience over redundancy.

Most projects these days are aware that they need to provide a certain level of specificity and "resets" of their own to ensure a consistent appearance. Worst case, the developer can choose to patch any display issues they run into themselves. (I suspect there won't be many with modern controls.)

At the end of the day, my argument for styling <table> without a class is the same for styling <a> or <h1> or even <strong> β€”Β it's an element, not a component, and Shoelace treats it as such.

from shoelace.

evansd avatar evansd commented on May 8, 2024

@claviska Yeah, I think you've probably made the right decision. I just saw that someone asked about the reasoning behind Bootstrap's decision and I remembered those issues.

from shoelace.

claviska avatar claviska commented on May 8, 2024

No worries. And I wasn't trying to target you specifically. Lots of eyes on this project today and people have certain expectations ("why isn't this like Bootstrap?") so I wanted to write down my thoughts.

I try to keep an open mind, so if there are other valid arguments I'm happy to listen.

from shoelace.

bpicolo avatar bpicolo commented on May 8, 2024

@claviska for what it's worth, I'm wondering if the logic behind it isn't that, when you want a differently styled variant, in the bootstrap model you just have to remove a class. In this case you'd need to explicitly unstyle all of the defaults.

Not to say shoelace's strategy is bad, it's just a con in the current model, though other models have cons too :)

from shoelace.

claviska avatar claviska commented on May 8, 2024

In this case you'd need to explicitly unstyle all of the defaults.

Well, it's either:

  1. Set defaults and require users to override a handful of properties if and only if they want to create a special variation

OR

  1. Don't set defaults and make users add redundant classes every time they want a table to look like a table

If you think about it, # 1 actually makes a lot of sense because the default styles are minimal and any variations a user wants to make will have a starting point that, aesthetically, is consistent with the rest of the library.

At least that's my thinking. πŸ€·β€β™‚οΈ

from shoelace.

bpicolo avatar bpicolo commented on May 8, 2024

@claviska it's reasonable thinking, and great job with the cool project :)

from shoelace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.