Replies: 4 comments 7 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Hmm, I may be misunderstanding something crucial here. I'm looking at 4.5.2 and my understanding is that this is where the .container max-widths for each breakpoint get generated:
Specifically as far as I can make out, it works because:
So we end up with @media definitions in the compiled file like this, where instead of .container-xs we get the plain .container class:
If this correct then before/now I could do:
But I don't see a way to do include the new definition in my own classes, at least in my limited understanding of Sass. Again, I might be completely misunderstanding what is happening here and any insight is appreciated. |
Beta Was this translation helpful? Give feedback.
-
Bumping... Anybody have any thoughts on this? Having had some time to think about this myself: it has probably always been a bad idea™ to try to include bootstrap internal mixins in our css. Mixins have never been available for all of bootstrap so I suppose it is fair to say this mode/usecase has never really been supported nor encouraged. |
Beta Was this translation helpful? Give feedback.
-
@mdo I swear I'm not being purposefully obtuse or argumentative, but I don't feel we're on the same page here about what we are discussing. I might not be communicating it well. Thanks for fixing my post formatting anyway.
Right, I'm not saying there should container-xs, which indeed by definition would act the same as .container (100% width up to the specified breakpoint size). I was specifically commenting that the nested loops width @function breakpoint-infix not returning the smallest infix is what generates the plain .container classes (as as in this example for breakpoint lg taken from style.css):
And if this is the case, then I don't see a way to extract the container functionality from that tightly coupled piece of code. I'm left using the deprecated make-container-max-widths() mixin that is no longer used by the bootstrap project itself. In fact it was once removed before it was discovered to some surprise that some projects have in fact used it as an @include in their own scss. So therefore, I would suggest that it is absolutely reasonable to assume, that this kind of usage of bootstrap
is not really supported by the project and never has been. I.e. it has never been the goal of bootstrap to make all or the core of its functionality available as mixins/functions/variables so that they may be easily included in custom class definitions. Which is fine ultimately, I would just prefer some clarity on this. |
Beta Was this translation helpful? Give feedback.
-
I've been using Bootstrap grid in Sass by @including Sass internal mixins such as make-container() make-row() make-col-ready() etc etc. As far as I know this common practice, but it seems this is not a use case that is officially supported by Bootstrap developers judging by issue 4.5.1 Breaking change, removed Mixing make-container-max-widths #31436 and the subsequent discussion at pull request Restore and deprecate make-container-max-widths mixin #31438 :
My current feeling based on this comment is that the other grid mixins will soon follow the same fate and that our current ability to include the mixins in our classes was more coincidental or happy accident rather than design decision. I had a quick look at the way container class generation was now done and it definitely didn't seem to support this use case.
If anybody who knows more about this situation can comment I would appreciate it. Right now I'm happily on v4.5.2 but the deprecation notice is sending a clear message.
Beta Was this translation helpful? Give feedback.
All reactions