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-config-htmlacademy

v5.0.0

Published

Stylelint Config for HTML Academy CODEGUIDE

Readme

Stylelint Config for HTML Academy Codeguide

npm version test license

Stylelint configuration for CSS, SCSS and LESS validation according to HTML Academy Codeguide.

Requirements

  • Node.js >= 24
  • Stylelint >= 17

Installation

npm install -D stylelint stylelint-config-htmlacademy

Usage

Create stylelint.config.js in your project root:

export default {
  extends: 'stylelint-config-htmlacademy',
};

Or add to your package.json:

{
  "stylelint": {
    "extends": ["stylelint-config-htmlacademy"]
  }
}

Key Features

  • Modern CSS — modern color functions (rgb(255 0 0), oklch(60% 0.15 240)), percentage lightness and alpha, modern media features (width >= 768px), no vendor prefixes, no @import in CSS.
  • BEM class names — strict block__element--modifier pattern, kebab-case throughout, single _ and chained modifiers rejected.
  • Property order — seven semantic groups (positioning, box model, typography, decoration, animation, interactivity), covering ~430 modern properties: container queries, anchor positioning, view transitions, scroll API, logical properties, masks, modern typography. Auto-fixable.
  • Selector hygiene — maximum 2 classes, 2 compound selectors, 2 combinators, 2 type selectors per chain; no ID selectors; no deprecated or invalid selectors; nested selectors must reference parent via &.
  • Naming patterns — kebab-case for custom properties, custom media, IDs, animations.
  • Code quality — no !important (warning), max 2 nesting levels, no single-line blocks, no duplicate properties.
  • Preprocessors — SCSS and LESS work out of the box, syntax detected by file extension, preprocessor-specific syntax (@include, @mixin, @use, fade()) allowed.

BEM Class Names

Class names must follow block__element--modifier BEM notation in lowercase:

/* Valid */
.button {}
.site-header {}
.button__icon {}
.button__icon-text {}
.button--primary {}
.button__icon--small {}

/* Invalid */
.Button {}                 /* uppercase */
.button_icon {}            /* single underscore */
.button--mod--extra {}     /* chained modifiers */

Alpha and Lightness Notation

Opacity, alpha channels and lightness in modern color functions must be expressed as percentages:

/* Valid */
.element {
  opacity: 50%;
  color: rgb(0 0 0 / 25%);
  background: oklch(60% 0.15 240);
}

/* Invalid */
.element {
  opacity: 0.5;
  color: rgb(0 0 0 / 0.25);
  background: oklch(0.6 0.15 240);
}

Run stylelint --fix to convert existing decimal values automatically.

Property Order

.element {
  /* Custom properties */
  --element-color: #333333;

  /* Positioning */
  position: absolute;
  inset: 0;
  z-index: 100;

  /* Box model */
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  margin: 10px;
  padding: 10px;
  overflow: hidden;

  /* Typography */
  font-family: "Arial", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  color: var(--element-color);

  /* Decoration */
  background-color: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
  opacity: 100%;

  /* Animation */
  transition: color 200ms;

  /* Interactivity */
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}

Run stylelint --fix to reorder properties automatically.

Preprocessors

SCSS and LESS are detected by file extension (.scss, .less). Preprocessor-specific at-rules (@include, @mixin, @use, @forward, @if, @for, @each, @content) and functions (fade() in LESS) are allowed. @import is allowed in preprocessors but forbidden in plain CSS.

Extending

Override rules in your stylelint.config.js:

export default {
  extends: 'stylelint-config-htmlacademy',
  rules: {
    'selector-class-pattern': null,
    'max-nesting-depth': 3,
  },
};

Editor Integration

Install the Stylelint extension for VS Code.

For auto-fix on save, add to .vscode/settings.json:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.stylelint": "explicit"
  },
  "stylelint.validate": ["css", "scss", "less"]
}

Links