{"action":"created","issue":{"url":"https://api.github.com/repos/frankmarineau/shrthnd.js/issues/4","labels_url":"https://api.github.com/repos/frankmarineau/shrthnd.js/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/frankmarineau/shrthnd.js/issues/4/comments","events_url":"https://api.github.com/repos/frankmarineau/shrthnd.js/issues/4/events","html_url":"https://github.com/frankmarineau/shrthnd.js/issues/4","id":65209813,"number":4,"title":"background crashes clean-css","user":{"login":"vmarkovtsev","id":2793551,"avatar_url":"https://avatars.githubusercontent.com/u/2793551?v=3","gravatar_id":"","url":"https://api.github.com/users/vmarkovtsev","html_url":"https://github.com/vmarkovtsev","followers_url":"https://api.github.com/users/vmarkovtsev/followers","following_url":"https://api.github.com/users/vmarkovtsev/following{/other_user}","gists_url":"https://api.github.com/users/vmarkovtsev/gists{/gist_id}","starred_url":"https://api.github.com/users/vmarkovtsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmarkovtsev/subscriptions","organizations_url":"https://api.github.com/users/vmarkovtsev/orgs","repos_url":"https://api.github.com/users/vmarkovtsev/repos","events_url":"https://api.github.com/users/vmarkovtsev/events{/privacy}","received_events_url":"https://api.github.com/users/vmarkovtsev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-30T13:20:18Z","updated_at":"2015-11-16T12:18:45Z","closed_at":null,"body":"shrthnd seems to mess up background in some cases.\r\n\r\nHow I test\r\n--------------\r\n\r\n```js\r\nfs = require('fs');\r\nfs.readFile('bootstrap.css', 'utf8', function (err,data) {\r\n  var source = data;\r\n  var shrthnd = require('shrthnd');\r\n  source = shrthnd(source).string;\r\n  var cleancss = require('clean-css');\r\n  var minified = new cleancss().minify(source).styles;\r\n});\r\n```\r\n\r\nReduced test case\r\n--------------------------\r\nPart of Bootstrap 3.3.4.\r\n\r\n```css\r\n.progress-striped .progress-bar,\r\n.progress-bar-striped {\r\n  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);\r\n  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);\r\n  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);\r\n  -webkit-background-size: 40px 40px;\r\n          background-size: 40px 40px;\r\n}\r\n```\r\n\r\nOccuring error\r\n-------------------\r\n\r\n```\r\n/tmp/shrthnd/node_modules/clean-css/lib/properties/validator.js:135\r\n      if (s.indexOf('/') < 0)\r\n           ^\r\nTypeError: Cannot read property 'indexOf' of undefined\r\n    at Object.module.exports.validator.isValidBackgroundPositionAndSize (/tmp/shrthnd/node_modules/clean-css/lib/properties/validator.js:135:12)\r\n    at module.exports.breakUp.background (/tmp/shrthnd/node_modules/clean-css/lib/properties/processable.js:239:28)\r\n    at Object.breakUp (/tmp/shrthnd/node_modules/clean-css/lib/properties/processable.js:153:25)\r\n    at Token.tokenizeOne (/tmp/shrthnd/node_modules/clean-css/lib/properties/token.js:93:47)\r\n    at Array.map (native)\r\n    at Function.Token.tokenize (/tmp/shrthnd/node_modules/clean-css/lib/properties/token.js:105:26)\r\n    at Optimizer.compact (/tmp/shrthnd/node_modules/clean-css/lib/properties/optimizer.js:258:24)\r\n    at Object.Optimizer.process (/tmp/shrthnd/node_modules/clean-css/lib/properties/optimizer.js:274:9)\r\n    at optimizeProperties (/tmp/shrthnd/node_modules/clean-css/lib/selectors/optimizers/advanced.js:711:27)\r\n    at _optimize (/tmp/shrthnd/node_modules/clean-css/lib/selectors/optimizers/advanced.js:730:5)\r\n\r\n```\r\n\r\nshrthnd output\r\n--------------------\r\n```css\r\n.progress-striped .progress-bar,\r\n.progress-bar-striped {\r\n  background: linear-gradient(45deg, rgba(255, 255, 255, .15) 25% 0 0/40px 40px, transparent 25% 0 0/40px 40px, transparent 50% 0 0/40px 40px, rgba(255, 255, 255, .15) 50% 0 0/40px 40px, rgba(255, 255, 255, .15) 75% 0 0/40px 40px, transparent 75% 0 0/40px 40px, transparent) 0 0/40px 40px;\r\n  -webkit-background-size: 40px 40px;\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/frankmarineau/shrthnd.js/issues/comments/157011212","html_url":"https://github.com/frankmarineau/shrthnd.js/issues/4#issuecomment-157011212","issue_url":"https://api.github.com/repos/frankmarineau/shrthnd.js/issues/4","id":157011212,"user":{"login":"dkerzig","id":3930150,"avatar_url":"https://avatars.githubusercontent.com/u/3930150?v=3","gravatar_id":"","url":"https://api.github.com/users/dkerzig","html_url":"https://github.com/dkerzig","followers_url":"https://api.github.com/users/dkerzig/followers","following_url":"https://api.github.com/users/dkerzig/following{/other_user}","gists_url":"https://api.github.com/users/dkerzig/gists{/gist_id}","starred_url":"https://api.github.com/users/dkerzig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkerzig/subscriptions","organizations_url":"https://api.github.com/users/dkerzig/orgs","repos_url":"https://api.github.com/users/dkerzig/repos","events_url":"https://api.github.com/users/dkerzig/events{/privacy}","received_events_url":"https://api.github.com/users/dkerzig/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T12:18:45Z","updated_at":"2015-11-16T12:18:45Z","body":"Same issue here"}}