Skip to content

v4: The Utilities Update #20684

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

Merged
merged 10 commits into from
Oct 9, 2016
Merged

v4: The Utilities Update #20684

merged 10 commits into from
Oct 9, 2016

Conversation

mdo
Copy link
Member

@mdo mdo commented Sep 9, 2016

Addressing a ton of things in one massive PR around our utilities. We've already broken each group of utilities out into new pages with #20068, and now I'm cleaning things up to make utilities more granular, easier to use, and more flexible to a multitude of use cases.

  • Changed syntax of spacing utilities to help avoid collision with Microformats (see .p-* class names conflict with Microformats #20185). This doesn't completely resolve the problem, however, because I want to move from .pa-*/.ma-* to just .p-* and .m-* to avoid a weird and unclear abbreviation of "all" there.
  • Revamps the text and background color utilities. Background utilities no longer set a color; you now apply that with a separate utility for more control. Also new is a .text-white for those common cases where you just want white text on dark background.
  • Renames .img-rounded an .img-circle to .rounded and .rounded-circle. Also, add new utilities for rounding a complete side of an element (e.g., .rounded-top or .rounded-right). (Pulls in commits from Renames .img-rounded to .rounded #20363 to fix Rename .img-rounded to .rounded #20266.)
  • Removes display: block; from .img-fluid. Responsive image behavior is not dependent on display: block;, so we can safely remove it on our end. Should you need block level, you can easily override that in the source or with a utility class.

Still to do:

  • Rename the .pull-* classes to reflect their CSS property, .float-*.
  • Update all instances of background utilities to ensure color contrast. Punting.
  • Consider reorganizing these new utility docs a bit more (e.g., combine display and responsive display, combine floats and clearfix, or something to that effect). Punting.
  • Update all URLs that link to and within the new utility docs.
  • Audit and make consistent use of !important.
  • Add vertical alignment utilities Punting to 4.1 ideas in Add vertical-align utilities #20866

Am I missing anything else major?

mdo and others added 6 commits September 8, 2016 22:15
- Rather than mix multiple properties in our color utilities, this splits all color and all background utils into separate classes.
- Adds new .text-white class to help lighten text color for darker backgrounds
- Move and rename .img-rounded to .rounded, .img-circle to .rounded-circle
- Add new .rounded-{direction} utils
- New docs pages for border utils with TBD comments for the border property
- Removes most image examples for rounding from the content/images docs in favor of new docs page
@bardiharborow
Copy link
Member

You'll need to remove Components/Utilities out of docs/_data/nav.yml now that it is in it's own section.

mdo added 4 commits September 9, 2016 21:24
Creating max-width images is not dependent on the display, so setting it is redundant. Cleans up the comments and implementation of the mixin as well.

Fixes #20767
@mdo mdo merged commit 821f719 into v4-dev Oct 9, 2016
@mdo mdo deleted the v4-utils branch October 9, 2016 21:55
@danawoodman
Copy link

.rounded-circle seems a bit redundant does it?

.#{$abbrev}-r-#{$size} { #{$prop}-right: $length-x !important; }
.#{$abbrev}-b-#{$size} { #{$prop}-bottom: $length-y !important; }
.#{$abbrev}-l-#{$size} { #{$prop}-left: $length-x !important; }
.#{$abbrev}-#{$size} { #{$prop}: $length-y $length-x !important; } // a = All sides

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this supposed to have the -a-?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Think of it like the CSS properties—margin-left goes with m-l while margin goes with m.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants