0.2.1 • Published 1 year ago

css-find-vars v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

css-find-vars

A CLI utility to find and list CSS variables in your project files.

Table of Contents

  • Installation
  • Usage
  • Options

Installation

To install this package, simply run:

npm install css-find-vars -g

This will install the css-find-vars command globally on your system.

Usage

You can run the utility from the command line as follows:

css-find-vars --dir ./path/to/your/css

Options

The following options are available:

OptionAliasTypeDefaultDescription
--helpShow help
--dir-dstring./Directory to search
--pattern-pstring--\w-+(?=;\s,}))CSS variable pattern
--extensions-earray".css", ".scss"File extensions to look for
--unique-ubooleanfalseReturn unique variables only
--order-ostringundefinedOrder variables alphabetically
--group-gstringundefinedGroup variables by the file

Examples

Find all CSS variables in a specific directory

To find all CSS variables in the ./styles directory:

css-find-vars --dir ./styles

Find and return only unique variables

To find all CSS variables in the ./styles directory and return unique variables only:

css-find-vars --dir ./styles --unique

Combine multiple options

To find all CSS variables in the ./styles directory, return unique variables, sort them in ascending order, and group them by the file:

css-find-vars --dir ./styles --unique --order ASC --group file
0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago