blakeembrey / free-style

Make CSS easier and more maintainable by using JavaScript
MIT License
707 stars 29 forks source link

example does not work for me #75

Closed bboydflo closed 5 years ago

bboydflo commented 5 years ago

Hi, so I cloned this repo and replaced the first line in the simple example

// var FreeStyle = require('../..')
var FreeStyle = require('free-style')

I also installed the lib using npm. then I did npm run build and npm run serve and got an error ("Uncaught TypeError: Style.inject is not a function").

Any tips on how to fix this?

blakeembrey commented 5 years ago

@bboydflo What's the example you're using? The documentation does not mention an inject method, though it was in older versions. Are you using old documentation?

blakeembrey commented 5 years ago

Oh! I see, I thought it was the example in the README. I'll update the example project now 👍

blakeembrey commented 5 years ago

Fixed with https://github.com/blakeembrey/free-style/commit/7220834db88614528ec9ad543b71c761fee1ae78, style injection was moved outside this library since it's usually in the domain of other libraries. E.g. https://github.com/blakeembrey/react-free-style uses an optimized DOM mutation for styles and can support server-side rendering.

bboydflo commented 5 years ago

great! thanks