I am facing a challenge in achieving different font sizes for various screen sizes. Despite my efforts to code smartly, the outcome is not as expected. After conducting some research, it appears there may be an issue with how queries and variables interact with each other, although I am uncertain. Below is an example of what I attempted:
@media (max-width: 768px) {
$h1-font-size: $font-size-base * 1.944;
$h2-font-size: $font-size-base * 1.555;
$h3-font-size: $font-size-base * 1.333 !default;
$h4-font-size: $font-size-base * 1.222 !default;
$h5-font-size: $font-size-base * 1.111 !default;
$h6-font-size: $font-size-base !default;
.mixin-testix {
font-size: 40px;
}
}
@media (min-width: 768px) and (max-width: 992px) {
$h1-font-size: $font-size-base * 2.222;
$h2-font-size: $font-size-base * 1.777;
$h3-font-size: $font-size-base * 1.388 !default;
$h4-font-size: $font-size-base * 1.222 !default;
$h5-font-size: $font-size-base * 1.111 !default;
$h6-font-size: $font-size-base !default;
}
@media (max-width: 992px) and (max-width: 1200px) {
$h1-font-size: $font-size-base * 2.777;
$h2-font-size: $font-size-base * 2.222;
$h3-font-size: $font-size-base * 1.666 !default;
$h4-font-size: $font-size-base * 1.222 !default;
$h5-font-size: $font-size-base * 1.111 !default;
$h6-font-size: $font-size-base !default;
}