@Mixin code not getting vendor prefixes
See original GitHub issueThe following is simplified, but roughly my code looks like this:
Current input:
#container {
@include align-children;
}
@mixin align-children {
& > * {
position: relative;
top: 50%;
transform: translateY(-50%);
}
}
Current output:
#container > * {
position: relative;
top: 50%;
transform: translateY(-50%);
}
Am I doing something incorrectly here? I know that having the following:
#container {
& > * {
position: relative;
top: 50%;
transform: translateY(-50%);
}
}
works fine with Autoprefixer as the vendor prefixes are all there.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Adding vendor prefixes with LESS mixin - Stack Overflow
The autoprefix plugin add browser prefixes leveraging the autoprefixer postprocessor. For client side compiling (in the browser) you can use -prefixfree.
Read more >Mixin to Prefix Properties - CSS-Tricks
In case you're interested in handling your own CSS vendor prefixing (rather than, say, Autoprefixer or Compass), here is a mixin to help ......
Read more >Sass Guidelines
An opinionated styleguide for writing sane, maintainable and scalable Sass.
Read more >SCSS prefix mixin - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >Documentation | U.S. Web Design System (USWDS)
If JavaScript fails users will still get a robust HTML foundation and all the ... like gulp-autoprefixer automatically add vendor prefixes to CSS...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If Autoprefixer doesn’t work with @mixin and @include, this sounds perfectly like an Autoprefixer issue.
But regardless, I was under the impression that Sass pre-processes CSS files and removes at-rules before Autoprefixer comes in sees:
Is this not the case?
Just put PostCSS (Autoprefixer is PostCSS plugin) after Sass. In this case Autoprefixer will work with CSS.