CLI tool that converts rgb(), rgba(), hex, hsl() and hsla() colors to oklch() in specified CSS files.

Overview

convert-to-oklch

CLI tool that converts rgb(), rgba(), hex, hsl() and hsla() colors to oklch() in specified CSS files.

npx convert-to-oklch ./src/**/*.css
.header {
- background: rgb(102, 173, 221);
+ background: oklch(72% 0.1 240);
}

oklch() provides better readability since it uses lightness, chroma, and hue components (closer to how people think and work with colors) instead of “magic tokens” like #4287f5. In contrast with hsl(), OKLCH has no issues with contrast and a11y.

Don’t forget to add postcss-preset-env to PostCSS to have oklch() polyfill.

More

Read more about color spaces in css:

You might also like...

Command line tool that converts HTML to markdown.

@wcj/html-to-markdown HTML conversion tool to markdown. command line tool = @wcj/html-to-markdown-cli. Installation This package is ESM only: Node 14

Nov 6, 2022

🌸 A cli can automatically generate files from Excel files.

🌸 A cli can automatically generate files from Excel files.

unxlsx A cli can automatically generate files from Excel files. Why We often need to export some information from XLSX to generate our files, such as

Aug 22, 2022

JavaScript library for parsing Dirtywave M8 files, complete with a CLI for interacting with M8 files.

m8-js This repository contains a JavaScript library for parsing Dirtywave M8 files, as well as a CLI for interacting with M8 files. The hopes are not

Dec 17, 2022

A CLI tool to embed interactive PUML diagrams to your github markdown files.

puml-for-markdown Simple CLI Usage Just run puml-for-markdown in any directory where you have markdown files and it will render links to PlantUML file

Jan 3, 2023

An interpreter for College Board's specified pseudocode for the AP Computer Science Principles Exam.

College Board Pseudocode Interpreter A playground for this interpreter is up on my website. This project is a mostly-functioning interpreter for Colle

Nov 16, 2022

An Obsidian plugin to add (prepend or append) specified content to a note (existing or new) without opening another pane.

An Obsidian plugin to add (prepend or append) specified content to a note (existing or new) without opening another pane.

Obsidian Note Content Pusher An Obsidian plugin to add (prepend or append) specified content to a note (existing or new) without opening another pane.

Nov 6, 2022

Tries to execute sync/async function, returns a specified default value if the function throws

good-try Tries to execute sync/async function, returns a specified default value if the function throws. Why Why not nice-try with it's 70+ million do

Dec 8, 2022

Calculate the Mexican RFC as specified by the SAT (Servicio de Administración Tributaria) for Personas Físicas

About The Project This project calculates a "Persona Física"'s RFC based on SAT's specifications including homonymy and verification digit. Built With

Nov 6, 2022

Debut plugin that provides additional candles of specified tickers to strategy.

debut-plugin-candles A plugin for Debut platform that provides additional candles of specified tickers to strategy. Install @debut/community-core shou

Dec 15, 2022
Comments
  • ignore colors with custom properties

    ignore colors with custom properties

    Fix #4.

    Converter should not try to convert colors with custom properties as it converts custom properties.

    • ignore color declarations that contain var(--
    • add better error handling
    opened by fpetrakov 0
  • Remove badges

    Remove badges

    • [x] Version badge is not very important for npx scripts since npx always use the latest version
    • [x] Downloads will demotivate new users. npx scripts always have low numbers since it is one-time tool.
    opened by ai 0
  • Improve docs

    Improve docs

    • [x] Add convert example, so people will understand what tool does just by looking example (people don’t like to read text before they were motivated)
    • [x] Add benefits of OKLCH, so people will understand why they need to call it
    • [x] Move examples above since it is the most important thing
    • [x] I remove Node.js requirement. We should not lose important space for rare Node.js 14 users (they will find an issue in terminal and will google a way to fix it).
    opened by ai 0
Releases(1.2.0)
Owner
Fedya Petrakov
Software Engineer 🇷🇺. JavaScript 🧡, TypeScript 💙 and a little bit of Rust 🦀.
Fedya Petrakov
A tiny utility library to generate mesh gradient based on 4 RGB colors, built with vanilla js.

MeshGradient.js mesh-gradient.js is tiny utility library to generate mesh gradient based on 4 RGB colors, built with vanilla js. Installation! npm ins

Anup Aglawe 7 Jan 4, 2023
A small CLI to sort any specified json files alphabetically

This is a small CLI to sort any specified json files alphabetically. This was created to sort localization files, but maybe you will find another use case.

PLAYT.net 4 Mar 20, 2022
chakra-radix-colors provides radix-ui color palettes, automatic dark mode, and acessible colors to chakra-ui applications

chakra-radix-colors chakra-radix-colors provides radix-ui color palettes, automatic dark mode, and acessible colors to chakra-ui applications. About C

null 11 Dec 30, 2022
CLI utility that parses argv, loads your specified file, and passes the parsed argv into your file's exported function. Supports ESM/TypeScript/etc out of the box.

cleffa CLI tool that: Parses argv into an object (of command-line flags) and an array of positional arguments Loads a function from the specified file

Lily Scott 9 Mar 6, 2022
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean Rodríguez 7 Sep 13, 2022
A Plugin which converts .md Files from Obsidian to your Kindle

Project 2: obsidian-kindle-export An Obsidian-Plugin which sends your Notes to your Kindle as .mobi File This is the exported .mobi File Introduction

Simerl 21 Dec 26, 2022
Get a quick hash that uses the well-liked Bernstein "times 33" hash method and delivers a hex string.

short-hash-ts -> Get a quick hash that uses the well-liked Bernstein "times 33" hash method and delivers a hex string. Installation Install short-hash

Younis Rahman 3 Sep 4, 2022
An interactive list of plugins for hex-rays' IDA Pro

Interactive IDA Plugin List This is a comprehensive list of plugins for IDA Pro that is more interactive, that is, it can be sorted and filtered to he

Vincent Mallet 106 Dec 26, 2022
A tiny isomorphic fast function for generating a cryptographically random hex string.

ZeptoID A tiny isomorphic fast function for generating a cryptographically random hex string. Accoding to this calculator one would have to generate i

Fabio Spampinato 9 Oct 24, 2022
The time represented as hex color values

A clock that represents the time as hex color values I saw a project a little while ago, where I discovered that the time (in format 00:00:00) works p

Jamel 39 Aug 16, 2022