replace(/:0 0 0 0([^\.])/g, ':0$1');
replace(/([: ,=\-])0\.(\d)/g, '$1.$2');
- // same values into one
+ // same 4 values into one
replace(/(padding|margin|border\-width):([\d\w\.%]+) ([\d\w\.%]+) ([\d\w\.%]+) ([\d\w\.%]+)/g, function(match, property, size1, size2, size3, size4) {
if (size1 === size2 && size1 === size3 && size1 === size4)
return property + ":" + size1;
return match;
});
+ // same 2 values into one
+ replace(/(padding|margin|border\-width):([\d\w\.%]+) ([\d\w\.%]+)([;}])/g, function(match, property, size1, size2, suffix) {
+ if (size1 === size2)
+ return property + ":" + size1 + suffix;
+ else
+ return match;
+ });
+
// restore rect(...) zeros syntax for 4 zeros
replace(/rect\(\s?0(\s|,)0[ ,]0[ ,]0\s?\)/g, 'rect(0$10$10$10)');
.fleuve .twit .texte_twit .nom,.article .twit .texte_twit .nom{display:block;color:#41c8f5;font-weight:700}
.fleuve .grid_3.titre_video{font-weight:700}
.fleuve section article{margin-bottom:0}
-.saisie{background-color:#f8f9fb;border:1px solid #b9c0c5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;padding:3px 3px;font-size:1.2rem;color:#747b83;outline:0}
+.saisie{background-color:#f8f9fb;border:1px solid #b9c0c5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;padding:3px;font-size:1.2rem;color:#747b83;outline:0}
.saisie:focus{border-color:#8b9299}
.radio_ou_checkbox,input[type="radio"],input[type="checkbox"]{cursor:pointer}
input[type="radio"],input[type="checkbox"]{vertical-align:bottom;margin-bottom:.2rem}
]
}),
'shorthands': cssContext({
- 'padding - same values': [
+ 'padding - same 4 values': [
'div{padding:1px 1px 1px 1px}',
'div{padding:1px}'
],
- 'margin - same values': [
+ 'margin - same 4 values': [
'div{margin:1% 1% 1% 1%}',
'div{margin:1%}'
],
- 'border-width - same values': [
+ 'border-width - same 4 values': [
'div{border-width:1em 1em 1em 1em}',
'div{border-width:1em}'
],
+ 'padding - same 2 values': [
+ 'div{padding:1px 1px}',
+ 'div{padding:1px}'
+ ],
+ 'margin - same 2 values': [
+ 'div{margin:5% 5%}',
+ 'div{margin:5%}'
+ ],
+ 'border-width - same 2 values': [
+ 'div{border-width:.5em .5em}',
+ 'div{border-width:.5em}'
+ ],
'different units': 'div{padding:1px 1em 1% 1rem}',
'fractions': [
'div{margin:.1em .1em .1em .1em}',