Skip to content

Add responsive display:block/inline/inline-block utility classes #18410

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

Closed
fridays opened this issue Dec 2, 2015 · 6 comments
Closed

Add responsive display:block/inline/inline-block utility classes #18410

fridays opened this issue Dec 2, 2015 · 6 comments

Comments

@fridays
Copy link

fridays commented Dec 2, 2015

It would be great to have some utility classes for each breakpoint:

.block
.block-sm
.block-md
.block-lg

.inline
.inline-sm
.inline-md
.inline-lg

.inline-block
.inline-block-sm
.inline-block-md
.inline-block-lg
@cvrebert
Copy link
Collaborator

cvrebert commented Dec 2, 2015

Can you give some examples of where this would be useful?

@cvrebert cvrebert changed the title Feature request: Responsive display block/inline/inline-block Add responsive display:block/inline/inline-block utility classes Dec 3, 2015
@fridays
Copy link
Author

fridays commented Dec 3, 2015

I think it would be useful for arranging elements when a grid or floats don't fit.

For example buttons that appear below each other on phones, but next to each other on higher screens:

<button class="btn block inline-sm">button 1</button>
<button class="btn block inline-sm">button 2</button>

Instead of buttons, this could be checkboxes, images or anything else.

@lancomega
Copy link

Do you find any solution, Iam interesting as well.

@fridays
Copy link
Author

fridays commented Dec 3, 2015

@lancomega You can use the following SCSS with v4 to make the classes available:

.block          { display: block; }
.inline         { display: inline; }
.inline-block   { display: inline-block; }

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-up($breakpoint) {
    .block-#{$breakpoint}           { display: block; }
    .inline-#{$breakpoint}          { display: inline; }
    .inline-block-#{$breakpoint}    { display: inline-block; }
  }
}

@mdo
Copy link
Member

mdo commented Dec 6, 2015

Not interested in adding these on top of our already included responsive utilities, thanks though!

@NuclearMachine
Copy link

tssk tssk annoying

@twbs twbs locked and limited conversation to collaborators Aug 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants