M
M
muminC2021-06-25 20:01:26
css
muminC, 2021-06-25 20:01:26

Why is @mixin not included from another file?

I have two scss files file-1 and file-2.
Goal: write a mixin in file-2 and include it in file-1 so that it works out

the code in file-1

@import url(file-2.css);
    p {
    @include font-color;
}


Code in file-2
@mixin font-color {
    color: yellow;
}


PS The import itself works, I checked it. When I copy the mixin to file-1 it works
Why do I need it? Here I gave a simple example, in the future I want to create a file and throw all the "cosmetics" (colors, fonts, etc.) there so that the file where I write the code does not fade

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2021-06-25
@muminC

Mixins are written in scss files. And you need to connect accordingly.

@import 'file2.scss';

p {
    @include font-color;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question