Socket
Socket
Sign inDemoInstall

stylelint-declaration-strict-value

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint-declaration-strict-value

Specify properties for which a variable, function, keyword or value must be used


Version published
Weekly downloads
241K
decreased by-4.94%
Maintainers
1
Weekly downloads
 
Created

What is stylelint-declaration-strict-value?

The stylelint-declaration-strict-value package is a plugin for Stylelint that enforces strict values for CSS properties. It helps maintain consistency and prevents the use of arbitrary values by allowing only predefined values or variables for specific CSS properties.

What are stylelint-declaration-strict-value's main functionalities?

Enforce specific values for properties

This feature allows you to enforce specific values for CSS properties. In this example, the rule enforces strict values for any property that includes 'color' in its name, while ignoring 'inherit' and 'transparent'.

{
  "rules": {
    "scale-unlimited/declaration-strict-value": [
      "/color/",
      {
        "ignoreValues": ["inherit", "transparent"]
      }
    ]
  }
}

Allow only variables for properties

This feature enforces the use of only variables for specific properties. In this example, the rule enforces that only CSS custom properties (variables) are used, while ignoring the value 'initial'.

{
  "rules": {
    "scale-unlimited/declaration-strict-value": [
      "/^--/",
      {
        "ignoreValues": ["initial"]
      }
    ]
  }
}

Custom property patterns

This feature allows you to enforce custom patterns for property values. In this example, the rule enforces that only custom properties with the prefix '--my-prefix-' are used, while ignoring the value 'unset'.

{
  "rules": {
    "scale-unlimited/declaration-strict-value": [
      "/^--my-prefix-/",
      {
        "ignoreValues": ["unset"]
      }
    ]
  }
}

Other packages similar to stylelint-declaration-strict-value

Keywords

FAQs

Package last updated on 06 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc