Skip to content
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

hide captions for for smaller viewports #18258

Closed
wants to merge 3 commits into from
Closed

hide captions for for smaller viewports #18258

wants to merge 3 commits into from

Conversation

bassjobsen
Copy link
Contributor

should close #18171

.btn {
text-shadow: none; // No shadow for button elements in carousel-caption
@include media-breakpoint-up(sm) {
display: block;

Choose a reason for hiding this comment

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

Properties should be ordered position, right, bottom, left, z-index, display, padding-top, padding-bottom, color, text-align, text-shadow

@bassjobsen
Copy link
Contributor Author

possibly also consider to apply sr-only() to hide the caption? But reset it will make the code more complex

Note it seems possible to do:

.carousel-caption {
  position: absolute;
  right: 15%;
  bottom: 20px;
  left: 15%;
  z-index: 10;
  padding-top: 20px;
  padding-bottom: 20px;
  color: $carousel-caption-color;
  text-align: center;
  text-shadow: $carousel-text-shadow;

  .btn {
    text-shadow: none; // No shadow for button elements in carousel-caption
  }

  @include media-breakpoint-down(xs) { 
    @include sr-only();
  }
}

@cvrebert
Copy link
Collaborator

/cc @patrickhlauke

@cvrebert cvrebert added this to the v4.0.0-alpha.2 milestone Nov 15, 2015
@patrickhlauke
Copy link
Member

Maybe I'm missing something here, but: if captions convey information, why should they be hidden, ever?

Turning them into screen-reader only text on small screen size will, paradoxically, make the information accessible to screen-reader users while not making it accessible to any other user group. Why? Are non-AT-users not supposed to get the info?

@cvrebert
Copy link
Collaborator

There is a general problem with the caption text getting cut off if there's insufficient room for it.
Example from #18140: Compare:
small
Versus:
supersmall
(The only difference being the viewport width)
Note how the heading in the caption got cut off in the latter screenshot.

However, this isn't particular to XS screens per se, so I agree that this PR's hiding scheme isn't a great solution.

@mdo Could you give your reasoning for #18171 (comment) ?

@bassjobsen
Copy link
Contributor Author

@patrickhlauke

non-AT-users not supposed to get the info?

Well non-AT-users can see the images of the carousel. But indeed i agree this make only sense when the information is only addtional to the images.
we shall wait for @mdo :)

@mdo
Copy link
Member

mdo commented Nov 30, 2015

My thought there was just how crazy they look with the captions overlaying things. Looking at the screenshots again, it'd be nice if the captions simply moved to the bottom of the images instead.

@mdo mdo modified the milestones: v4.0.0-alpha.2, v4.0.0-alpha.3 Dec 8, 2015
@mdo mdo modified the milestones: v4.0.0-alpha.3, v4.0.0-alpha.4 May 8, 2016
@iatek
Copy link
Contributor

iatek commented Sep 9, 2016

A workaround I've found is using CSS 3 object-fit:cover (no IE9, edge, etc..) which makes the img behave more like a background image so that it can be scaled properly along with the caption.

http://www.codeply.com/go/EaMgFMhff2

@mdo mdo modified the milestones: v4.0.0-alpha.5, v4.0.0-alpha.6 Oct 19, 2016
@mdo
Copy link
Member

mdo commented Dec 5, 2016

This can be optionally handled with display utilities. Example coming with #21298.

@mdo mdo closed this Dec 5, 2016
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.

6 participants