Socket
Book a DemoInstallSign in
Socket

@db-ui/stylelint

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@db-ui/stylelint

Ensures DB UX styles are used correctly

latest
Source
npmnpm
Version
0.7.4
Version published
Maintainers
0
Created
Source

@db-ui/stylelint

Validate the correct usage of DB UX in your (S)CSS code.

Installation

npm install stylelint @db-ui/stylelint --save-dev

Note: We recommend installing stylelint-config-standard, stylelint-use-logical & @double-great/stylelint-a11y as well.


## Usage

Add this to your `.stylelintrc.json` configuration file:

```json
{
	"plugins": [
		...
		"@db-ui/stylelint"
	]
}

Rules

Enable rules inside your .stylelintrc.json with:

{
	rules: {
		"db-ui/use-spacings": [true], // margins, paddings, gaps
		"db-ui/use-border-height": [true], // border-width & border
		"db-ui/use-border-radius": [true], // border-radius
		"db-ui/use-border-color": [true] // border-color & border
	}
}

Additional settings

There are some additional settings for every rule which can be applied to the .stylelintrc.json:

{
	rules: {
		"db-ui/use-xxx": [
			true,
			{
				allowCalc: true, // allow all calc() functions - they are hard to lint
				ignore: ["test.scss"], // ignore specific files
				allow: {
					// allow additional values e.g. for SASS or exceptions/workarounds
					startsWith: ["map.get"],
					includes: ["--custom-gap"],
					exact: ["$custom-padding"]
				}
			}
		]
	}
}

Keywords

stylelint

FAQs

Package last updated on 06 Feb 2025

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