-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplify modifier classes #11794
simplify modifier classes #11794
Comments
It's done the way it is deliberately; see http://markdotto.com/2012/02/16/scope-css-classes-with-prefixes/ for some explanation why. |
Prefixing names is great, it can prevent unwanted side effects. So what about the prefix
I am talking from modifier classes. They stand for the meaning which the semantic name of the modifier suggests. You have to documented them in any case, also if you have prefixes.
I am talking from modifier classes, by convention they should have only style definition in combination with a base class. So if they stand alone, they have to have no effect.
That could be shown in a matrix.
yes, absolutely easy.
Same problem you have with prefixed classes, isn't it? |
We'll stick to the pattern we use today (although I know we deviate at times, and that'll change in v4). |
I do not know, if this is the right place for a discussion, but I found no better for now. So I start it here.
The bone of contention
Many controls and components have their own class modifier, but want say the same.
For instance
class="text-danger"
for paragraphsclass="danger"
in tables rows or cellsclass="btn btn-danger"
for buttonsclass="alert alert-danger"
for alertsclass="progress-bar progress-bar-danger"
for progress barsclass="panel panel-danger"
for panelsclass="label label-danger"
for labelsAll that want one result, a different look, a modification of the default look, but we need to use 7 different ways to say it.
The proposal
For me it would be looks easier to learn and to document, if we combine the base class with common modifier classes. So we would have some classes to specify the coloring:
default
primary
orbrand
orhighlight
success
info
warning
danger
orerror
we would have some classes to specify the state:
active
orpressed
focus
hover
disabled
and some for size:
size-xs
size-sm
size-md
size-lg
To modify an item, you than could combine this modifiers:
class="btn danger size-lg"
instead of
class="btn btn-danger btn-lg"
class="progress-bar danger size-lg"
instead of
class="progress-bar progress-bar-success progress-bar-lg"
I know, this would be a big change and could only realized in the next major version, but I think this would improve Bootstrap and I like to know, how you think about this.
The text was updated successfully, but these errors were encountered: