Is it possible to provide support for browsers lacking flexbox compatibility (such as IE) while using SASS mixins?
I have been quickly implementing the display:flex
property with the following mixin. However, I am facing challenges with IE and need to manually change classes to display:table
and display:table-cell
by utilizing Modernizr, as not all browsers fully support display:flex
.
@mixin flexbox() {
display: -webkit-box !important;
display: -moz-box !important;
display: -ms-flexbox !important;
display: -webkit-flex !important;
display: flex !important;
}
Is there a way to refactor my mixin based on whether it is within a body
element containing the class of flexboxlegacy
or no-flexboxlegacy
?