BinaryMoon / ElementalCSS

A classless CSS library with utility classes
9 stars 0 forks source link

Some Amazingly Dumb Questions #3

Closed sgclark closed 1 year ago

sgclark commented 2 years ago

Hi Ben

Just received the "MasterWP" newsletter and saw the link to the CSS library you are working on. Really great idea/approach. Was tooling around a bit on the temp site you created and was just a little confused as to how to install the package of CSS files on my site. I'm not a full on dev so just need a bit more detail to understand how to implement this on my WP site.

Thanks Stephen

BinaryMoon commented 2 years ago

Hi Stephen - thanks for the questions. Not dumb at all, I suspect I will need to answer these on my website.

When you send folks here on Github, there is no "DOWNLOAD" button. When I go here on Github, there are several additional files that are downloaded with the CSS files/package. Which is the right set of code to include on my WP site? How do I handle that on my server?

At the moment you can copy the files you need from the dist folder. In the longer term I would like to add support for a cdn of some sort so that you can enqueue the remote files.

You note 3 files on the site yet there are 6 (understood the additional ones are compressed versions of the base 3 files) in the above GitHub link. Should I include all 6 on my server?

You only need to copy the files you want to use, and you only need to load the files you want to use. I generate different versions of the files so that you can just use the bits you want, or everything.

Assuming I can just take the 3 (or 6) CSS files, put them in a folder titled "elementalcss" on my server, and then @import them into my main CSS file that my Wordpress site uses?

You can load them however you like. If you are distributing a theme/ plugin then I would recommend enqueueing the css using PHP and the wp_enqueue_ functions but if it's for your own site only then using @import is fine.

Is it possible/acceptable to simply @import the 'raw' CSS files directly into my WP CSS file so that way whenever you make updates to the base code, it will be updated automatically on my site?

You mean load them from Github? I imagine it would work but it might not be that quick. I've just done a bit of searching and it seems you can use jsdelivr to do the same thing: https://cdn.jsdelivr.net/gh/BinaryMoon/ElementalCSS/dist/elementalcss.min.css

This will use the latest version on your site.

sgclark commented 2 years ago

Thanks Ben. All responses make sense. All questions are related to my own website www.sgclark.com.

Thanks for JSDeliver link. That may be the way I go to 'kick the tires' with this on my site. I've been meaning to take a look at, and clean up, all the 'self authored' CSS I use on my site (it is a bit of a mess - I keep on adding and tweaking things and its gotten a bit out of hand over time) and I suspect using your package here would really help me clean that up further.

Stephen