twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.35k stars 78.8k forks source link

Add extra classes to min-vh-* #40567

Open pythonistical opened 3 months ago

pythonistical commented 3 months ago

Prerequisites

Proposal

Increase the scope of class min-vh-*. From only having min-vh-100, it should also include-

Motivation and context

The inadequacy of the min-vh-* class is reflected in this Stack Overflow question-https://stackoverflow.com/questions/78636386/min-vh-50-is-not-behaving-as-expected-in-bootstrap-css Ultimately the answer was given in the comments which concluded that Bootstrap doesn't define min-vh-50.

The motivation behind this change is to avoid the alignment problems and confusion that can occur without these classes as demonstrated above.

julien-deramond commented 3 months ago

This topic has been partially discussed in several previous issues, such as issue #29697 and issue #29488. While these issues aren't exactly the same, they are in a similar vein. At that time, the decision was made not to include this feature in the framework.

I'll defer to @mdo, who has more historical context on this matter, to decide whether we should close this feature request.

In the meantime, without adding this to the framework by default, you can define the missing classes using our Utility API.

$utilities: map-merge(
  $utilities,
  (
    "min-viewport-height":
    (
      property: min-height,
      class: min-vh,
      values: (25: 25vh, 50: 50vh, 75: 75vh)
    ) 
  )
);

It will generate the missing classes mentioned in the description of this issue:

.min-vh-25 {
  min-height: 25vh !important;
}
.min-vh-50 {
  min-height: 50vh !important;
}
.min-vh-75 {
  min-height: 75vh !important;
}
pythonistical commented 3 months ago

@mdo @julien-deramond I have noticed, that the same excuse was given in all such feature requests that 'not enough people have requested it', the same reason is once again despite even a SO issue stemming from this. I think the feature should be added to the core as it's not as rare as we think.