css-grid-polyfill icon indicating copy to clipboard operation
css-grid-polyfill copied to clipboard

Add note how to install

Open MartinMuzatko opened this issue 7 years ago • 6 comments

npm install and require('css-grid-polyfill')

MartinMuzatko avatar Nov 29 '17 21:11 MartinMuzatko

I didn't find anything in npm packages. Is it available?

Sideness avatar Dec 07 '17 11:12 Sideness

I am not sure if it is installable at all. I couldn't find a way.. Looking at the package.json it looks like it is called css-polyfills.

MartinMuzatko avatar Dec 07 '17 12:12 MartinMuzatko

I'll keep trying to install it (or just make it work) in the next hours. If I find anything, I'll let you know!

Sideness avatar Dec 07 '17 12:12 Sideness

There is no npm package. Just include js file in old way.

zendu avatar Dec 07 '17 12:12 zendu

Yes. I just did that and it worked! I added in my root react component

 componentDidMount(){
      injectTapEventPlugin();
      let script = document.createElement('script');
      script.src = "css-polyfills.min.js";
      script.type = "text/javascript";

      document.getElementsByTagName('body')[0].appendChild(script);
  }

And i did the trick. Good luck :)

Sideness avatar Dec 07 '17 12:12 Sideness

I would indeed recommend to use the script directly. There is a bower port courtesy of https://github.com/FremyCompany/css-grid-polyfill/issues/24 but I don't think it is entirely up to date (probably not).

At the same time, it's a good time to remind people that the project currently isn't actively maintained by anyone so using this in production should be really done with caution only.

IMPORTANT NOTE: The Grid specification has undergone several major changes since this polyfill was written, and I have not had time to work on keeping the polyfill up to date. I welcome contributions and am ready to help, but I do not have time to commit on fixing issues myself at this time.

I might have some time during the holiday period to finish the work of some of the pull requests that have been submitted but not entirely ironed out by their authors, so there might be an update coming that would help us bring this closer to the current spec, but there is still a fair amount of work remaining.

Be cautious out there ;)

FremyCompany avatar Dec 07 '17 20:12 FremyCompany