Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
360 views
in Technique[技术] by (71.8m points)

javascript - Postcss Mixins根据选择器添加间距(Postcss Mixins adding spacings depending on the selector)

Want to add mixins margin-bottom for a specific selector.

(想要为特定选择器添加mixins底边距。)

If its 'header' to be negative margin of '-60px', or if the selector is container the margin-bottom to be '60px'

(如果其“标头”为“ -60像素”的负边距,或者选择器为容器,则底部距为“ 60像素”)

Some of my code trying

(我的一些代码尝试)

module.exports = function (mixin, header, container, negative) {

  if(header && negative) {
    return {
      'margin-bottom': '-60px'
    }
  }
}

and in css to be called something like this

(并在CSS中被称为这样的东西)

@mixin spacings header negative;

negative = Boolean

(否=布尔)

  ask by Teni translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...