J
J
Jealfe2020-03-05 19:49:58
Sass
Jealfe, 2020-03-05 19:49:58

How to set background color parameter in mixins?

mixin color-group(color, description, value)
    .color-group
        .color-group__color(style={background:`color`}) ---?
        h2.color-group__description=description
        p.color-group__value=value


there is a mixin in which I want to pass the background color .color-group__color in the color parameter. then paste in this way into the pug file

+color-group('#1F2041', 'Текст', 'Еще какой то текст')
            +color-group(другой цвет,   .. ,  ..)
            +color-group(и еще другой,   .. ,  ..)


how to implement it correctly so that it works?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
inkShio, 2020-03-05
@Jealfe

mixin color-group(color, description, value)
  .color-group
    .color-group__color(style={background: color})
      h2.color-group__description= description
      p.color-group__value= value

+color-group('#1F2041', 'Текст', 'Еще какой то текст')
+color-group('#ccc', 'Текст 2', 'Еще какой то текст 2')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question