All Projects → joereynolds → Mort

joereynolds / Mort

Licence: mit
Dead CSS detection

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Mort

Openseedbox
OpenSeedbox - Open Source Multi-User Bittorrent Web UI
Stars: ✭ 101 (-7.34%)
Mutual labels:  frontend
Wasmplay
WASM Web "Framework" Playground
Stars: ✭ 105 (-3.67%)
Mutual labels:  frontend
Flowy Vue
Vue Flowy makes creating flowchart or hierarchy chart functionality an easy task. Build automation software, mind mapping tools, organisation charts, or simple programming platforms in minutes by implementing the library into your project.
Stars: ✭ 107 (-1.83%)
Mutual labels:  frontend
Torch Web
🌍 Web interface to tcping servers
Stars: ✭ 103 (-5.5%)
Mutual labels:  frontend
Dotnet Unpkg
Pure .NET front-end HTML package management using unpkg.com as a source
Stars: ✭ 103 (-5.5%)
Mutual labels:  frontend
Vue Relay
🖖 🔛 🗂 A framework for building GraphQL-driven Vue.js applications.
Stars: ✭ 105 (-3.67%)
Mutual labels:  frontend
Cfp List
Конференции по фронтенду, принимающие доклады на русском языке
Stars: ✭ 101 (-7.34%)
Mutual labels:  frontend
Griddd
A dead simple, customisable, flexbox-based griddd
Stars: ✭ 108 (-0.92%)
Mutual labels:  frontend
Node Frontend
Node.js Docker image with all Puppeteer dependencies installed for frontend Chrome Headless testing and default Nginx config, for multi-stage Docker building
Stars: ✭ 104 (-4.59%)
Mutual labels:  frontend
Ionic Framework
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
Stars: ✭ 45,802 (+41920.18%)
Mutual labels:  frontend
Tachyons Verbose
Functional CSS for humans. Verbose edition.
Stars: ✭ 102 (-6.42%)
Mutual labels:  frontend
Frontend knowledge
📚 Important Frontend Knowledge(前端知识汇总)
Stars: ✭ 103 (-5.5%)
Mutual labels:  frontend
Suzaku
Suzaku web UI framework for Scala
Stars: ✭ 107 (-1.83%)
Mutual labels:  frontend
Play2 Html5tags
HTML5 form tags module for Play Framework
Stars: ✭ 101 (-7.34%)
Mutual labels:  frontend
Typo3 Rector
Rector for TYPO3
Stars: ✭ 107 (-1.83%)
Mutual labels:  refactoring
Frontend
🍭 Frontend for Home Assistant
Stars: ✭ 1,366 (+1153.21%)
Mutual labels:  frontend
Cyclow
A reactive frontend framework for JavaScript
Stars: ✭ 105 (-3.67%)
Mutual labels:  frontend
Pepper
🌶️ Create reactive frontends without ever writing frontend code.
Stars: ✭ 109 (+0%)
Mutual labels:  frontend
Biliob Frontend
The frontend part of biliob.
Stars: ✭ 108 (-0.92%)
Mutual labels:  frontend
Mithril Isomorphic Example
Example of an isomorphic mithril application
Stars: ✭ 107 (-1.83%)
Mutual labels:  frontend

Mort

Detects dead CSS.

Build Status

A demonstration of Mort

Installing

You can use the binaries on the releases page for versions 1.5 and above.

Or if you like, use npm.

npm i mort-css

Or globally with

npm i -g mort-css

You should then be able to run mort.

Usage

cd to the root of the project you're interested in and run mort to scan that css file against your codebase.

Normal use

mort -f your-css-file.css

Verbose output

mort -f your-css-file.css -v

Forcing use of git grep

mort -f your-css-file.css -p gitgrep

Stdin

If no arguments are supplied, mort reads from stdin.

i.e.

cat my-css-file.css | mort

or

echo "#my-selector-to-hunt-for" | mort

Multiple CSS files

It's possible to scan multiple CSS files with mort.

ls assets/css/*.css | xargs -L1 mort -v -f 

Ignoring some files with find

find -iname *.scss -not -path "./node_modules/*" | xargs -L1 mort -vf

Options

  Usage: mort [options]

  Options:

    -V, --version               output the version number
    -u, --usage-count <number>  Show warnings for any css selector <= usage-count. (default: 0)
    -v, --verbose               Detailed information about the matches will be displayed.
    -f, --file <path>           The css file to run mort against.
    -p, --program <program>     Force mort to use a grep program of your choice. Supported ones are 'ripgrep', 'gitgrep', and 'grep'.
    -h, --help                  output usage information

-u --usage-count

This will show all selectors that are <= to the specified count.

i.e.

mort -f your-css-file.css -u 3

Will display all selectors that are used 3 times or less. This is particularly useful to find selectors that can be combined into classes etc...

-v --verbose

This toggles verbosity. There are currently 3 levels of verbosity.

Level 1

mort -f somefile.css -v

Level 1 displays what file it is scanning and the line count for that selector.

Level 2

mort -f somefile.css -vv

Level 2 displays level 1 + The command used to find the selector

Level 3

mort -f somefile.css -vvv

Level 3 displays level 1 + level 2 and shows all selectors it is searching through (regardless of whether they are used or not).

-f --file

The file to run mort against. If unspecified, mort will read from stdin.

-p --program

Which grep program to use. The default is ripgrep as it's the quickest. Supported grep programs are ripgrep, gitgrep, and grep.

Note that grep is incredibly slow so is not recommended

Using the default (ripgrep)

mort -f somefile.css

Using git grep

mort -f somefile.css -p gitgrep

Using grep

mort -f somefile.css -p grep

Requirements

  • One of either:
    • ripgrep
    • git grep
    • grep (Not recommended, very slow with mort)

Note that this tool can't detect all use cases. For example, string-concatting a selector in JS will probably bypass the tool.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].