madeleineostoja / postcss-responsive-type

Automagical responsive typography, built on PostCSS
372 stars 21 forks source link

Responsive 'px' restriction is not working #10

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi, when using font-size: responsive; it works fine

however adding font-size: responsive 12px 16px; generates the following error in my terminal

events.js:141
      throw er; // Unhandled 'error' event
      ^
TypeError: Cannot read property 'toString' of null
    at getUnit (/d/stupid-starter/node_modules/postcss-responsive-type/index.js:77:36)
    at buildRules (/d/stupid-starter/node_modules/postcss-responsive-type/index.js:95:20)
    at /d/stupid-starter/node_modules/postcss-responsive-type/index.js:185:20
    at /d/stupid-starter/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:102:34
    at /d/stupid-starter/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:73:26
    at Rule.each (/d/stupid-starter/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:60:22)
    at Rule.walk (/d/stupid-starter/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:72:21)
    at Rule.walkDecls (/d/stupid-starter/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:100:25)
    at /d/stupid-starter/node_modules/postcss-responsive-type/index.js:174:12
    at /d/stupid-starter/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:115:34
╭─sebastian@SebastiansMBP2 /d/stupid-starter  ‹master*› 
╰─➤    

Anyideas why it might be happening?

madeleineostoja commented 8 years ago

What version of PostCSS/gulp-postcss are you using? 5.0 was a breaking change, only reason I can think this would be happening, since the tests (https://github.com/seaneking/postcss-responsive-type/blob/master/test/fixtures/shorthand.css#L2) account for shorthand props like this.

ghost commented 8 years ago

gulp-postcss is at "version": "6.1.0"

adam-beck commented 8 years ago

@sebastiangraz would you be able to post your css code? Can you not get it working for even the simplest of cases? The only thing I could think of if the regexs fail to parse your CSS declarations (i.e. because of a typo).

ghost commented 8 years ago

You may close this issue. I reinstalled all the dependencies on a new codebase and its working fine. Maybe not safari though but thats another issue