Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoprefixer duplicates -ms-interpolation-mode declaration #632

Closed
mathiasbynens opened this issue Mar 25, 2016 · 3 comments
Closed

Autoprefixer duplicates -ms-interpolation-mode declaration #632

mathiasbynens opened this issue Mar 25, 2016 · 3 comments
Labels

Comments

@mathiasbynens
Copy link

Given the following input:

canvas {
    -ms-interpolation-mode: nearest-neighbor; /* IE */
    image-rendering: -webkit-optimize-contrast; /* Old Android, Safari, UC Browser */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* Safari */
    image-rendering: pixelated; /* Chrome & Opera */
}

Actual Autoprefixer output (with default settings):

canvas {
    -ms-interpolation-mode: nearest-neighbor; /* IE */
    image-rendering: -webkit-optimize-contrast; /* Old Android, Safari, UC Browser */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* Safari */
    -ms-interpolation-mode: nearest-neighbor;
        image-rendering: pixelated; /* Chrome & Opera */
}

Note that -ms-interpolation-mode: nearest-neighbor; is now duplicated.

Simple test case to reproduce the issue:

// `npm i autoprefixer postcss`
'use strict';
const autoprefixer = require('autoprefixer');
const postcss = require('postcss');

const plugin = autoprefixer();

const css = `
canvas {
    -ms-interpolation-mode: nearest-neighbor; /* IE */
    image-rendering: -webkit-optimize-contrast; /* Old Android, Safari, UC Browser */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* Safari */
    image-rendering: pixelated; /* Chrome & Opera */
}
`;

postcss([ autoprefixer ]).process(css).then(function(result) {
    result.warnings().forEach(function(warn) {
        console.warn(warn.toString());
    });
    console.log(result.css);
});
@ai
Copy link
Member

ai commented Mar 25, 2016

Thanks. I will try to fix it on this weekend.

@ai
Copy link
Member

ai commented Mar 27, 2016

Done 01476c9

@ai ai closed this as completed Mar 27, 2016
@ai
Copy link
Member

ai commented Mar 27, 2016

Released in 6.3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants