question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do autoprefixer support gradient?

See original GitHub issue

I have a style like this:

#header{
    position: absolute;
    z-index: 9999;
    height: 40px;
    width: 100%;
    top: -40px;
    overflow: hidden;
    transform: translate(0px, 40px);
    background: gradient(linear,0 0,0 100%,from(#E6E6E6),to(#D1D5D6));
    box-shadow: 0 2px 1px 0 #A3A5A8;
}

but after autoprefixer, css like this:

#header {
  position: absolute;
  z-index: 9999;
  height: 40px;
  width: 100%;
  top: -40px;
  overflow: hidden;
  -webkit-transform: translate(0px, 40px);
  -ms-transform: translate(0px, 40px);
  -o-transform: translate(0px, 40px);
  transform: translate(0px, 40px);
  background: gradient(linear,0 0,0 100%,from(#E6E6E6),to(#D1D5D6));
  box-shadow: 0 2px 1px 0 #A3A5A8;
}

so the background: gradient(linear,0 0,0 100%,from(#E6E6E6),to(#D1D5D6)); is invalid in chrome, I’ve expected a vendor prefix -webkit would be added, but didn’t.

Do the tool support gradient? Or Do I set error?

Best Regards

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
poradacommented, Aug 2, 2013

This is incorrect syntax. I believe this is what you wanted:

#header {
   background: linear-gradient(to bottom, #e6e6e6 50%, #d1d5d6 100%);
}
1reaction
qcgm1978commented, Aug 2, 2013

You are great. The code now perfect by autoprefixer.Thank you. Best Regards

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can Autoprefixer replace linear-gradient with simple color for ...
So i want to have background: #45678a; in case when linear-gradient doesn't support (i.g. ie8). Does it possible with autoprefixer or some ...
Read more >
Autoprefixer: A Postprocessor for Dealing with Vendor ...
By default, Autoprefixer will support 2 latest versions of major browsers, ... a { background: linear-gradient(to top, black, white); ...
Read more >
autoprefixer - npm
No. Autoprefixer only adds prefixes, not polyfills. There are two reasons: Prefixes and polyfills are very different and need a different API.
Read more >
Say goodbye to vendor prefixes with Autoprefixer
Autoprefixer is a tool that adds vendor prefixes to CSS based on the usage patterns and current state of support. This results in...
Read more >
autoprefixer | Yarn - Package Manager
Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website ... Fixed support of unit-less zero...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found