AndyOGo / stylelint-declaration-strict-value

Specify properties for which a variable, function, keyword or value must be used.
MIT License
134 stars 10 forks source link

No validation when rgb/rgba/hsl colors are used #325

Closed acherkashin closed 1 year ago

acherkashin commented 1 year ago

I use the following stylelint configuration

module.exports = {
  plugins: ['stylelint-declaration-strict-value'],
  files: ['**/*.css'],
  rules: {
    'scale-unlimited/declaration-strict-value': [
      ['color', 'background-color', 'font-size', 'font-weight', 'font-family', 'border-color'],
      {
        ignoreValues: ['currentColor', 'unset', 'inherit', 'initial', 'transparent'],
      },
    ],
  },
};

Everything works fine, for hex colors, font-weight, font-size and so on.

But when I use rgb/rgba/hsl functions to set up color, I don't see any validations.

image
AndyOGo commented 1 year ago

@acherkashin Please try to configure ignoreFunctions

acherkashin commented 1 year ago

@AndyOGo

I set up ignoreFunctions to false and now it works.

image image

But when I use variable inside drop-shadow function, I still have validation.

image

I understand, it happens because we need to use variable for whole value of filter property, but is there way to now show this validation when at least part of the value contain variable like in my case?

AndyOGo commented 1 year ago

@acherkashin Variables as function parameters are not supported.