Gathering detailed insights and metrics for postcss-markdown
Gathering detailed insights and metrics for postcss-markdown
Gathering detailed insights and metrics for postcss-markdown
Gathering detailed insights and metrics for postcss-markdown
@stylelint/postcss-markdown
PostCSS syntax for parsing Markdown
postcss-github-markdown-css
PostCSS plugin to add TailwindCSS `class` support to `sindresorhus/github-markdown-css`
mine.css
Classless stylesheet for markdown documents evolved from style.css
x-markdown-css
A simple and customizable markdown CSS stylesheet for everyone.
npm install postcss-markdown
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.4
Supply Chain
98.2
Quality
81.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
177,093,825
Last Day
42,443
Last Week
228,812
Last Month
1,000,309
Last Year
11,975,445
MIT License
4 Stars
116 Commits
3 Watchers
12 Branches
7 Contributors
Updated on Apr 20, 2025
Minified
Minified + Gzipped
Latest Version
1.3.0
Package Id
postcss-markdown@1.3.0
Unpacked Size
29.48 kB
Size
9.39 kB
File Count
11
NPM Version
10.8.2
Node Version
20.18.1
Published on
Jan 14, 2025
Cumulative downloads
Total Downloads
Last Day
45.3%
42,443
Compared to previous day
Last Week
3.6%
228,812
Compared to previous week
Last Month
-3%
1,000,309
Compared to previous month
Last Year
-25.8%
11,975,445
Compared to previous year
5
25
PostCSS syntax for parsing Markdown
First thing's first, install the module:
1npm install postcss-markdown --save-dev
If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install the corresponding module.
1const postcss = require("postcss"); 2const syntax = require("postcss-markdown")({ 3 // Enable support for HTML (default: true) 4 htmlInMd: true, 5 // syntax for parse scss (non-required options) 6 scss: require("postcss-scss"), 7 // syntax for parse less (non-required options) 8 less: require("postcss-less"), 9 // syntax for parse css blocks (non-required options) 10 css: require("postcss-safe-parser"), 11}); 12const autoprefixer = require("autoprefixer"); 13postcss([autoprefixer]) 14 .process(source, { syntax: syntax }) 15 .then(function (result) { 16 // An alias for the result.css property. Use it with syntaxes that generate non-CSS output. 17 result.content; 18 });
input:
# title
```css
::placeholder {
color: gray;
}
```
output:
# title
```css
::-moz-placeholder {
color: gray;
}
:-ms-input-placeholder {
color: gray;
}
::placeholder {
color: gray;
}
```
If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install these module:
1const options = { 2 rules: [ 3 { 4 // custom language 5 test: /^postcss$/i, 6 lang: "scss", 7 }, 8 { 9 // custom language 10 test: /^customcss$/i, 11 lang: "custom", 12 }, 13 ], 14 15 // custom parser for CSS (using `postcss-safe-parser`) 16 css: "postcss-safe-parser", 17 // custom parser for SASS (PostCSS-compatible syntax.) 18 sass: require("postcss-sass"), 19 // custom parser for SCSS (by module name) 20 scss: "postcss-scss", 21 // custom parser for LESS (by module path) 22 less: require.resolve("./node_modules/postcss-less"), 23 // custom parser for SugarSS 24 sugarss: require("sugarss"), 25 // custom parser for custom language 26 custom: require("postcss-custom-syntax"), 27}; 28const syntax = require("postcss-markdown")(options);
PostCSS can be temporarily turned off by using special comments in your Markdown. For example:
<!-- postcss-ignore -->
```css
a {
color: red;
}
```
The main use case of this plugin is to apply linting with Stylelint to CSS (and CSS-like) code blocks in markdown file.
You can use it by configuring your stylelint
config as follows:
1{ 2 "overrides": [ 3 { 4 "files": ["*.md", "**/*.md"], 5 "customSyntax": "postcss-markdown" 6 } 7 ] 8}
Use the stylelint.vscode-stylelint extension that Stylelint provides officially.
You have to configure the stylelint.validate
option of the extension to check .md
files, because the extension does not check the *.md
file by default.
Example .vscode/settings.json:
1{ 2 "stylelint.validate": [ 3 ..., 4 // ↓ Add "markdown" language. 5 "markdown" 6 ]
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-04-28
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More