hayaku/Hayaku-Bundle — Issue #6: Auto-values in abbreviations
Author: kizu
Created: 2011-11-20 11:08:01+00:00
State: open

One of the best features in Hayaku is expanding the abbreviations with the auto detecting units:

ml10 → margin-left: 10px;
p-.5 → padding: .5em;
h2p → height: 2px;
h2pe → height: 2%;
h2pt → height: 2pt;

If the digit is in the abbreviation, it means that you must change the way you parse the abbreviation a little: you mustn't find the textual value in abbreviation, so in `ml10` you must only search for the `ml` in properties and add `10px` to it's value.

- If the value in abbreviations is integer, then it's `px`;
- If the value in abbreviation is float, then it's `em`;
- there must be a shortcut to percents, so you could write them more easily than pressing `shift+5`, so the allias is `percents`, so you could write just `pe` and Hayaku must'd guess it right.
- If there is some full unit (or anything unknown), nothing extra would happen.