anandthakker/doiuse
anandthakker/doiuse has 1,303 GitHub stars and 59 forks. GitHot measured 0 stars in 24 hours and +1 in 7 days. Last checked 2026-11-13 18:22 UTC. Last push 2026-03-10.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
:bomb: Lint CSS for browser support against caniuse database.
데이터README.md
Originaldoiuse
Lint CSS for browser support against Can I use database.
Install
npm install -g doiuse
Usage Examples
Command Line
doiuse --browsers "ie >= 9, > 1%, last 2 versions" main.css
# or
cat main.css | doiuse --browsers "ie >= 9, > 1%, last 2 versions"
Sample output:
/projects/website/main.css:5:3: CSS3 Box-sizing not supported by: IE (8-11), Chrome (36-38), Safari (8,7.1), Opera (24-25), iOS Safari (8,7.1,8.1), Android Browser (4.1,4.4,4.4.4), IE Mobile (10-11)
/projects/website/main.css:6:3: CSS3 Box-sizing not supported by: IE (8-11), Chrome (36-38), Safari (8,7.1), Opera (24-25), iOS Safari (8,7.1,8.1), Android Browser (4.1,4.4,4.4.4), IE Mobile (10-11)
/projects/website/main.css:8:3: CSS user-select: none not supported by: IE (8-9)
/projects/website/main.css:9:3: CSS user-select: none not supported by: IE (8-9)
/projects/website/main.css:10:3: CSS user-select: none not supported by: IE (8-9)
/projects/website/main.css:11:3: CSS user-select: none not supported by: IE (8-9)
/projects/website/main.css:12:3: CSS user-select: none not supported by: IE (8-9)
/projects/website/main.css:13:3: Pointer events not supported by: IE (8-10), Firefox (32-33), Chrome (36-38), Safari (8,7.1), Opera (24-25), iOS Safari (8,7.1,8.1), Android Browser (4.1,4.4,4.4.4), IE Mobile (10)
/projects/website/main.css:14:3: Pointer events not supported by: IE (8-10), Firefox (32-33), Chrome (36-38), Safari (8,7.1), Opera (24-25), iOS Safari (8,7.1,8.1), Android Browser (4.1,4.4,4.4.4), IE Mobile (10)
/projects/website/main.css:32:3: CSS3 Transforms not supported by: IE (8)
Use --json to get output as (newline-delimited) JSON objects.
JS
import postcss from 'postcss';
import DoIUse from 'doiuse/lib/DoIUse.js';
postcss(new DoIUse({
browsers:['ie >= 6', '> 1%'],
ignore: ['rem'], // an optional array of features to ignore
ignoreFiles: ['**/normalize.css'], // an optional array of file globs to match against original source file path, to ignore
onFeatureUsage: (usageInfo) => {
console.log(usageInfo.message);
}
})).process("a { background-size: cover; }")
CommonJS syntax is still supported if using var doiuse = require('doiuse').
Gulp (CommonJS)
var gulp = require('gulp')
var postcss = require('postcss')
var doiuse = require('doiuse')
gulp.src(src, { cwd: process.cwd() })
.pipe(gulp.postcss([
doiuse({
browsers: [
'ie >= 8',
'> 1%'
],
ignore: ['rem'], // an optional array of features to ignore
ignoreFiles: ['**/normalize.css'], // an optional array of file globs to match against original source file path, to ignore
onFeatureUsage: function (usageInfo) {
console.log(usageInfo.message)
}
})
]))
How it works
In particular, the approach to detecting features usage is currently quite naive.
Refer to the data in /data/features.js.
- If a feature in that dataset only specifies
properties, we just use those properties for regex/substring matches against the properties used in the input CSS. - If a feature also specifies
values, then we also require that the associated value matches one of those values.
API Details
As a transform stream
var doiuse = require('doiuse/stream');
process.stdin
.pipe(doiuse({ browsers: ['ie >= 8', '> 1%'], ignore: ['rem'] }))
.on('data', function (usageInfo) {
console.log(JSON.stringify(usageInfo))
})
Yields UsageInfo objects as described below.
As a postcss plugin
postcss(new DoIUse(opts)).process(css), where opts is:
{
browsers: ['ie >= 8', '> 1%'], // an autoprefixer-like array of browsers.
ignore: ['rem'], // an optional array of features to ignore
ignoreFiles: ['**/normalize.css'], // an optional array of file globs to match against original source file path, to ignore
onFeatureUsage: function(usageInfo) { } // a callback for usages of features not supported by the selected browsers
}
And usageInfo looks like this:
{
message: '<input source>: line <l>, col <c> - CSS3 Gradients not supported by: IE (8)',
feature: 'css-gradients', // slug identifying a caniuse-db feature
featureData: {
title: 'CSS Gradients',
missing: "IE (8)", // string of browsers missing support for this feature.
missingData: {
// map of browser -> version -> (lack of)support code
ie: { '8': 'n' }
},
caniuseData: { // data from caniuse-db/features-json/[feature].json }
},
usage: {} //the postcss node where that feature is being used.
}
Called once for each usage of each css feature not supported by the selected browsers.
Ignoring file-specific rules
For disabling some checks you can use just-in-place comments
/* doiuse-disable */
Disables checks of all features
/* doiuse-disable feature */
Disables checks of specified feature(s) (can be comma separated list)
/* doiuse-enable */
Re-enables checks of all features
/* doiuse-enable feature */
Enables checks of specified feature(s) (can be comma separated list)
- for following lines in file
Contributing
doiuse is an OPEN Open Source Project.
This means that individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
License
MIT
NOTE: Many of the files in test/cases are from autoprefixer-core, Copyright 2013 Andrey Sitnik [email protected]. Please see https://github.com/postcss/autoprefixer-core.
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,703 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,889 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,493 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,518 스타