Skip to content

mgiuffrida/CSSMinister

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

This is a mirror of http://www.vim.org/scripts/script.php?script_id=3006

CSSMinister provides functions and mappings that convert any hexadecimal, keyword, RGB(A) or HSL(A) color values from one format to another.  The functions fall into two categories:  1) those that change the next matching color only, and 2) those that change all colors matching the requested format in a range or in the entire buffer.

Functions that change formats one color at a time include:

  :ToHex
  :ToRGB
  :ToRGBA
  :ToHSL
  :ToHSLA

Functions that change all colors matching the requested color format in a range or in the entire buffer:

  :ToHexAll <format>
  :ToRGBAll <format>
  :ToRGBAAll <format>
  :ToHSLAll <format>
  :ToHSLAAll <format>

Where <format> is the color format you're converting from.

As of v1.0.0, the above commands replace the old key mappings as a less obtrusive solution for converting between different color formats. Some key mappings remain for those that prefer them:

  <leader>x - convert to hex
  <leader>r - convert to rgb
  <leader>h - convert to hsl
  <leader>ra - convert to rgba
  <leader>ha - convert to hsla

This script was tested with CSS, Sass and Less stylesheets.  However, it should work anywhere CSS color values are used.

About

Converts colors in CSS stylesheets from one format to another

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vim Script 100.0%