L
L
Lara B2018-04-23 10:54:35
HTML
Lara B, 2018-04-23 10:54:35

Why doesn't font size change work when using a mixin?

1. I decided to use mixins to change the font size at different screen width changes. in 2. base .less specified a font size of 62.5%
3. in the _variable.less file I created a mixin, where for each resolution I specified a font in %
4. I use this mixin for menu links in the _header.less file
5. in the end why then for 768px screens the font has become a little more than 9px
PS Do not pay attention that the links do not disappear in the mobile version, and are visible simultaneously with the hamburger icon, I will do all this later. I took a training layout from this one, I want to practice in mixins https://lareta064.github.io/Bouncy/ 5add90cb8cf55633485645.jpeg5add90d7305e0248170568.jpeg5add90e958860854759998.jpeg5add90f5125d9762630364.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Sharomet, 2018-04-23
@Lara164

Everything works for you as you wrote in less.
When the screen resolution is greater than 767px

@media(min-width: 768px)
these styles work:
.header__menu a {
    font-size: 150%;
}

When the resolution is less than 768px these are:
.header__menu a {
    font-size: 1.6rem;
}

Remove ".screen-sm" from "header__menu a" and it will always be 1.6rem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question