Skip to content

Deprecated linear-gradient syntax #2363

@altras

Description

@altras

Howdy!

In our project we're using https://github.com/jenius/autoprefixer-stylus and chosen.js and from that combo I saw a couple of warnings like:

{ type: 'warning',
  text: 'Gradient has outdated direction syntax. New syntax is like "to left" instead of "right".',
  node: 
   { type: 'decl',
     parent: 
      { nodes: [Object],
        type: 'rule',
        parent: [Object],
        source: [Object],
        before: '',
        between: '',
        selector: '.chosen-container-single .chosen-single',
        semicolon: false,
        after: '',
        lastEach: 10,
        indexes: {},
        _autoprefixerDisabled: false,
        _autoprefixerPrefix: false },
     source: { start: [Object], input: [Object], end: [Object] },
     before: '',
     prop: 'background',
     between: ':',
     value: 'linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%)',
     _autoprefixerDisabled: false,
     _autoprefixerPrefix: false,
     _autoprefixerValues: { '-webkit-': '-webkit-linear-gradient(top, #fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%)' } },
  plugin: 'autoprefixer' } 0 [ { type: 'warning',
    text: 'Gradient has outdated direction syntax. New syntax is like "to left" instead of "right".',
    node: 
     { type: 'decl',
       parent: [Object],
       source: [Object],
       before: '',
       prop: 'background',
       between: ':',
       value: 'linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%)',
       _autoprefixerDisabled: false,
       _autoprefixerPrefix: false,
       _autoprefixerValues: [Object] },
    plugin: 'autoprefixer' } ]

I see in some places (https://github.com/harvesthq/chosen/blob/master/sass/chosen.scss#L278, https://github.com/harvesthq/chosen/blob/master/sass/chosen.scss#L67) that indeed chosenjs is using deprecated linear-gradient syntax top instead of to top

Since it's an easy fix I would like to understand in the first place is it necessary to use the old deprecated syntax :? Seeing this post postcss/autoprefixer#473 (comment) -> Wrong gradient direction creates real problems. I'm wondering how we should approach this warning? xD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions