Splitting icon indicating copy to clipboard operation
Splitting copied to clipboard

Generic `--distance` & `--percent` vars

Open shshaw opened this issue 7 years ago • 3 comments

Don’t directly use the --char-index, instead, use a --split-index var and a --split-total var that are set based on what you’re targeting.

Then the --distance and other values can be based on those vars, and then with .char { --split-index: --char-index; }, --distance within that .char becomes based on the char’s values

shshaw avatar Aug 08 '18 14:08 shshaw

Proof of concept: https://codepen.io/shshaw/pen/1433da294c16062e8907c8c46f5c57a6

Seems to be working 👍

shshaw avatar Aug 08 '18 22:08 shshaw

Is the split index in addition to char index or a replacement?

notoriousb1t avatar Aug 09 '18 00:08 notoriousb1t

It's a reference to it, at least in .char!

.splitting .word {
  --split-index: var(--word-index);
  --split-total: var(--word-total);
}

.splitting .char {
  --split-index: var(--char-index);
  --split-total: var(--char-total);
}

This way --split-percent, etc, can be used for .word, .cell, you name it!

No changes needed to JS. Should be able to deploy in splitting.css

shshaw avatar Aug 09 '18 03:08 shshaw