source: imaps-frontend/node_modules/clean-css/lib/optimizer/level-1/property-optimizers/border-radius.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 5 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.2 KB
Line 
1var OptimizationLevel = require('../../../options/optimization-level').OptimizationLevel;
2
3var plugin = {
4 level1: {
5 property: function borderRadius(_rule, property, options) {
6 var values = property.value;
7
8 if (!options.level[OptimizationLevel.One].optimizeBorderRadius) {
9 return;
10 }
11
12 if (values.length == 3 && values[1][1] == '/' && values[0][1] == values[2][1]) {
13 property.value.splice(1);
14 property.dirty = true;
15 } else if (values.length == 5 && values[2][1] == '/' && values[0][1] == values[3][1] && values[1][1] == values[4][1]) {
16 property.value.splice(2);
17 property.dirty = true;
18 } else if (values.length == 7 && values[3][1] == '/' && values[0][1] == values[4][1] && values[1][1] == values[5][1] && values[2][1] == values[6][1]) {
19 property.value.splice(3);
20 property.dirty = true;
21 } else if (values.length == 9 && values[4][1] == '/' && values[0][1] == values[5][1] && values[1][1] == values[6][1] && values[2][1] == values[7][1] && values[3][1] == values[8][1]) {
22 property.value.splice(4);
23 property.dirty = true;
24 }
25 }
26 }
27};
28
29module.exports = plugin;
Note: See TracBrowser for help on using the repository browser.