0.1.1 • Published 8 years ago

mini-style v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

mini-style

A bunch of shortened CSS class for element styling.

THIS PROJECT IS PARTIALLY IMPLEMENTED. USE AT YOUR OWN RISK.

BE WARNED : It may have some conflict naming in the future. Please consider create an issue if you find one.

Shortcuts

ShorthandPropertiesExampleResult
w#widthw20width: 20px;
h#heighth20height: 20px;
mmarginm#mt#mb#ml#mr#mx#my#margin: #px;margin-top: #px;margin-bottom: #px;margin-left: #px;margin-right: #px;margin-left: #px; margin-right: #px;margin-top: #px; margin-bottom: #px;
ppaddingp#pt#pb#pl#pr#px#py#padding: #px;padding-top: #px;padding-bottom: #px;padding-left: #px;padding-right: #px;padding-left: #px; padding-right: #px;padding-top: #px; padding-bottom: #px;
b,i,ufont-stylebiufont-width: bold;font-style: italic;text-decoration: underline
ffloatflfrfnfloat: left;float: right;float: none;
cclearclcrcbcnclear: left;clear: right;clear: both;clear: none;
cfclear fixcf.cf:after { context: ""; display: block; clear:both }
ffont-sizefssfsfbfbbfont-size: smaller;font-size: smallfont-size: large;font-size: larger;
ddisplaydndbdidibdtditdisplay: none;display: block;display: inline;display: inline-block;display: table;display: inline-table;
c,l,rtext-alignclrtext-align: center;text-align: left;text-align: right;
vvertical-alignvtvmvbvttvtbvertical-align: top;vertical-align: middle;vertical-align: bottom;vertical-align: text-top;vertical-align: text-bottom; }
vvisibilityvvvhvcvisibility: visible;visibility: hidden;visibility: collapse;
bsbox-sizingbsbbscbox-sizing: border-box;box-sizing: content-box;
ppositionpspaprpfposition: static;position: absolute;position: relative;position: fixed;
t,b,l,rpositioningt#b#l#r#top: #px;bottom: #px;left: #px;right: #px;
ooverflowosohovoaoverflow: scroll;overflow: hidden;overflow: visible;overflow: auto;
oxoverflow-xoxsoxhoxvoxaoverflow-x: scroll;overflow-x: hidden;overflow-x: visible;overflow-x: auto;
oyoverflow-yoysoyhoyvoyaoverflow-y: scroll;overflow-y: hidden;overflow-y: visible;overflow-y: auto;
wwword-wrapwwnwwbword-wrap: normal;word-wrap: break-word;
wbword-breakwbnwbbwbkword-break: normal;word-break: break-all;word-break: keep-all
lsletter-spacing
ccursor
ccolorcRGBcRRGGBBcRRGGBBAAcolor: #RRGGBB;color: #RRGGBB;color: rgba(RR, GG, BB, AA);
rresizerxryrbrnresize: horizontal;resize: vertical;resize: both;resize: none;
totext-overflowtoctoetext-overflow: clip;text-overflow: ellipsis;
tltable-layouttlatlftable-layout: auto; table-layout:fixed
zz-indexz1000z-index: 1000;

Modifiers

Change the condition

Selector/Property modifers

ModifierEffectExampleResult
!!importantw20!.w20! { width: 20px !important; }
(min(w20.(w20 { min-width: 20px; }
)maxw20).w20) { max-width: 20px; }
:media querylg:w20@media lg(min-width: 1120px) { .lg:w20 { max-width: 20px; } }
.ifc.w20.c.w20 { width: 20px; }
@event selectorc@hover.c@hover:hover { text-align: center; }
|Modernizr feature conditionw20|canvas.canvas .w20 { width: 20px; }
?Developer helperw?w?1.w? { width: 20px !important; }.w?1 { width: 20px !important; }

Unit Modifiers

ModifierEffectExampleResult
/fractiongd1/2.gd1/2 { width: 50%; }
ppercentw20p.w20p { width: 20%; }
.literal fractionls1.3.ls1.3 { letter-spacing: 1.3px; }
aautomxa.mxa { margin-left: auto; margin-right: auto; }

Color digits

Use 3, 4, 6, 8 digit to specific the color code in hex based. and alpha channel in dex based.

Use h suffix to use hsl color space.

Remark : no 1, 2 digits because there are conflict with other class ( cb, cf ) | Digits | Example | Result | | 3 | c999 | color: #999; | | 3 | c999h | color: hsl( 9/16, 90%, 90% ); | | 4 | c9999 | color: rgba( 144, 144, 144, 0.9 ); | | 4 | c9999h | color: hlsa( 9/16, 90%, 90%, 0.9 ); | | 6 | c999999 | color: #999999; | | 6 | c999999h | color: hsl( 99/255, 99%, 99% ); | | 8 | c99999999 | color: rgba( 144, 144, 144, 0.99 ); | | 8 | c99999999h | color: hsla( 99/255, 99%, 99%, 0.99 ); |

TO-DO

  • Implement all the selector matching.
  • Write gulp script to generate CSS class that found or included in script.
  • Add warning when there are too many mini-style on one element.
  • Add lab color space.