-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Add .w-100
as width: 100% utility class
#19234
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
Conversation
@@ -1,3 +1,7 @@ | |||
// Width | |||
|
|||
.w-100 { width: 100% !important; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!important should not be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would take a more generic identifier like .full-width
instead, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current name parallels the naming of the other utilities and sets a pattern that additional width utilities can follow (e.g. .w-50
).
Also, .w-100
indicates exactly what the class does (width: 100%
, and nothing else) (albeit utilizing an abbreviation), whereas .full-width
could potentially be interpreted differently (e.g. max-width: 100%
, display: block
) by readers lacking context.
This will also address #19202. |
What about adding breakpoints to w-100 utlity class? In many cases element must be 100% until X breakpoint. For example buttons, dropdowns custom form inputs and other elements on mobile should be 100% while on larger screens elements must keep auto width they have by default. Something like Please note that I am against adding xs to 1st element same as in discussion about .hidden because:
|
Added documentation in a follow-up commit. |
Thanks @cvrebert! |
Fixes #19221.
Any other width utilities to seriously consider?