_images.less 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Responsive images (ensure images don't scale beyond their parents)
  2. //
  3. // This is purposefully opt-in via an explicit class rather than being the default for all `<img>`s.
  4. // We previously tried the "images are responsive by default" approach in Bootstrap v2,
  5. // and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps)
  6. // which weren't expecting the images within themselves to be involuntarily resized.
  7. // See also https://github.com/twbs/bootstrap/issues/18178
  8. .img-fluid {
  9. #img-fluid();
  10. }
  11. // Image thumbnails
  12. .img-thumbnail {
  13. padding: @thumbnail-padding;
  14. background-color: @thumbnail-bg;
  15. border: @thumbnail-border-width solid @thumbnail-border-color;
  16. #border-radius(@thumbnail-border-radius);
  17. #box-shadow(@thumbnail-box-shadow);
  18. // Keep them at most 100% wide
  19. #img-fluid();
  20. }
  21. //
  22. // Figures
  23. //
  24. .figure {
  25. // Ensures the caption's text aligns with the image.
  26. display: inline-block;
  27. }
  28. .figure-img {
  29. margin-bottom: (@spacer / 2);
  30. line-height: 1;
  31. }
  32. .figure-caption {
  33. #font-size(@figure-caption-font-size);
  34. color: @figure-caption-color;
  35. }