X
X
xonar2019-08-28 23:20:14
css
xonar, 2019-08-28 23:20:14

Why doesn't mixin work in scss?

Hello.
Help me to understand. There are 2 scss files in one file, I create a mixin, and in the second I want to include it. But, it throws an error.
This is how I specify the mixin:

[email protected]mixin button{
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    background: #54cff0;
    color: #fff;
    border-radius: 50px;
    padding: 15px 30px;
    margin-top: 20px;
    text-transform: uppercase;
}

And this is how I add it in another file:
.form__button{
    @include button; //пробовал button(); тоже не выходит
}

Build Error :
Error in plugin "sass"
Message:
source\scss\header.scss
Error: Invalid CSS after "}": expected 1 selector or at-rule, was "[email protected] button{"
on line 163 of source/ scss/header.scss
from line 1 of source/scss/form.scss
>> }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rustam Bainazarov, 2019-08-28
@xonar

Do you read documentation at all? :))

@mixin button() {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    background: #54cff0;
    color: #fff;
    border-radius: 50px;
    padding: 15px 30px;
    margin-top: 20px;
    text-transform: uppercase;
}

A
Alexander Loginov-Solonitsyn, 2019-08-29
@kasheibess

By the fact that it's time to switch to Stylus =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question