Placeholder Mixin SCSS/CSS

前端 未结 6 818
挽巷
挽巷 2020-11-28 01:34

I\'m trying to create a mixin for placeholders in sass.

This is the mixin I\'ve created.

@mixin placeholder ($css) {
  ::-webkit-input-placeholder {         


        
6条回答
  •  野性不改
    2020-11-28 02:00

    To avoid 'Unclosed block: CssSyntaxError' errors being thrown from sass compilers add a ';' to the end of @content.

    @mixin placeholder {
       ::-webkit-input-placeholder { @content;}
       :-moz-placeholder           { @content;}
       ::-moz-placeholder          { @content;}
       :-ms-input-placeholder      { @content;}
    }
    

提交回复
热议问题