stylelint-declaration-use-variable icon indicating copy to clipboard operation
stylelint-declaration-use-variable copied to clipboard

display error in line color: inherit;

Open mykola-shkut opened this issue 5 years ago • 6 comments

stylelint could you tell how to fix?

mykola-shkut avatar Sep 04 '19 21:09 mykola-shkut

If you added color to the properties array (see docs), you can add inherit to the ignoreValues array (see docs).

Example:

'sh-waqar/declaration-use-variable': [
    [
    '/color/'
    {
        ignoreValues: [
        'inherit'
        ]
    }
]

fuhlig avatar Nov 05 '19 12:11 fuhlig

Unfortunately this doesn't work for me, i have pasted the example configuration from the docs. Anyone still experiencing this? I am working with .scss content, could there be a relation?

I am using: [email protected] [email protected]

daddyj avatar Apr 18 '20 17:04 daddyj

Ok, fixed the issue by reading the Readme more precisely :D

the properties and the secondaryOption must be wrapped in an array - so the following respects all properties and ignoreValues:

    'sh-waqar/declaration-use-variable': [
      [
        '/color/',
        'background',
        'background-color',
        { ignoreValues: ['inherit'] },
      ],
    ],

IMHO this issue can therefore be closed.

daddyj avatar Apr 18 '20 18:04 daddyj

If you added color to the properties array (see docs), you can add inherit to the ignoreValues array (see docs).

Example:

'sh-waqar/declaration-use-variable': [
    [
    '/color/'
    {
        ignoreValues: [
        'inherit'
        ]
    }
]

@fuhlig Your configuration should display a syntax error because you are missing a closing bracket ] at the bottom. Then everything should work as expected.

daddyj avatar Apr 18 '20 18:04 daddyj

this should work

        'sh-waqar/declaration-use-variable': [
            [
                '/color/',
                { ignoreValues: ['inherit'] },
            ],
        ],

kepi0809 avatar Sep 24 '20 05:09 kepi0809

Issue can be closed, thanks :)

fuhlig avatar Feb 09 '21 10:02 fuhlig