npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stylelint-plugin-display-multi-keyword-syntax

v0.1.1

Published

Stylelint plugin to enforce multi-keyword syntax for display property

Downloads

6

Readme

stylelint-plugin-display-multi-keyword-syntax

MIT License

A Stylelint plugin that enforces the use of multi-keyword syntax for the display property.

Motivation

The CSS Display Module Level 3 introduces a new multi-keyword syntax for the display property. This syntax explicitly separates the outer display type (how the element participates in the parent's layout) from the inner display type (how the element's children are laid out).

For example:

  • display: block should now be display: block flow
  • display: inline-block should now be display: inline flow-root
  • display: grid should now be display: block grid

This plugin helps you modernize your CSS by enforcing the use of these more explicit and descriptive multi-keyword values. Adopting this syntax improves code clarity, consistency, and prepares your codebase for the future of CSS.

Installation

npm install --save-dev stylelint-plugin-display-multi-keyword-syntax

or

yarn add --dev stylelint-plugin-display-multi-keyword-syntax

Usage

Add stylelint-plugin-display-multi-keyword-syntax to your Stylelint configuration plugins array, then add the plugin/display-multi-keyword-syntax rule to your rules object.

{
  "plugins": ["stylelint-plugin-display-multi-keyword-syntax"],
  "rules": {
    "plugin/display-multi-keyword-syntax": true
    // ... other rules
  }
}

Options

The plugin/display-multi-keyword-syntax rule has the following options:

Primary option: true

Setting the primary option to true enables the rule. It will report single-keyword display values that have multi-keyword equivalents as defined in the CSS Display Module Level 3.

Example:

/* With "plugin/display-multi-keyword-syntax": true */

/* ❌ Problematic CSS (will be flagged) */
.element1 {
  display: block; /* Should be 'block flow' */
}
.element2 {
  display: inline-block; /* Should be 'inline flow-root' */
}
.element3 {
  display: flex; /* Should be 'block flex' */
}
.element4 {
  display: inline-grid; /* Should be 'inline grid' */
}

/* ✅ Correct CSS (will not be flagged) */
.element1 {
  display: block flow;
}
.element2 {
  display: inline flow-root;
}
.element3 {
  display: block flex;
}
.element4 {
  display: inline grid;
}

Secondary options

These options are provided as an object in the second item of the rule's array:

fix: boolean

  • Default: false

If true, this rule will automatically fix the reported single-keyword display values to their multi-keyword equivalents.

Configuration Example:

{
  "rules": {
    "plugin/display-multi-keyword-syntax": [true, { "fix": true }]
  }
}

Behavior with fix: true:

/* Input CSS */
.example {
  display: inline-flex;
}

/* Output CSS (after Stylelint --fix) */
.example {
  display: inline flex;
}

severity: "warning" | "error"

  • Default: "error"

Sets the severity level for this rule. Issues from this rule will be reported as errors by default. You can change this to "warning" if you prefer.

Configuration Example:

{
  "rules": {
    "plugin/display-multi-keyword-syntax": [true, { "severity": "warning" }]
  }
}

Supported Mappings

This plugin uses the following mappings to identify and (if fix is enabled) convert single-keyword values to their multi-keyword equivalents. These mappings are based on the CSS Display Module Level 3 specification for common display values that have a direct two-value keyword equivalent.

| Single Keyword | Multi-Keyword Equivalent | | ------------------ | ------------------------ | | block | block flow | | flow-root | block flow-root | | inline | inline flow | | inline-block | inline flow-root | | run-in | run-in flow | | list-item | block flow list-item | | inline list-item | inline flow list-item | | flex | block flex | | inline-flex | inline flex | | grid | block grid | | inline-grid | inline grid | | ruby | inline ruby | | table | block table | | inline-table | inline table |

Ignored Values

The rule is designed to focus on the common single-keyword values that have direct two-keyword (<outer-display> <inner-display>) equivalents. Therefore, it will ignore:

  • Values that are already multi-keyword (e.g., block flow, inline grid).
  • Special-purpose display values like none and contents.
  • Legacy single-keyword display values that do not map directly to the <outer-display> <inner-display> model (e.g., table-row-group, table-cell, table-caption, etc.). These values remain valid as single keywords.

License

MIT