Skip to content

Why is Bootstrap so verbose? #31263

Answered by mdo
ugultopu asked this question in General
Jul 8, 2020 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

So, instead of defining a CSS class that needs to be added to every link under a nav, why Bootstrap cannot just:

.nav a {
  display: block;
  padding: .5rem 1rem;
}

We're verbose because we're explicit. Your above example means that anytime you add another random <a> element within a <nav> element, it's always going to be block level with that padding. Most of the time, you don't want that. Our approach is class-driven for that reason.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ugultopu
Comment options

@mdo
Comment options

mdo Jul 9, 2020
Maintainer

Answer selected by mdo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants