NMSCD / NMSCD.github.io-Redesign

🚧 WIP redesign of Community Developers & Designers Website
https://redesign.nmscd.com
GNU General Public License v3.0
0 stars 0 forks source link

Understanding the files and remove potentially unnecessary files #6

Open Lenni009 opened 1 year ago

Lenni009 commented 1 year ago

There are some files that seem a little confusing to me:

We should also minify all the code assets in the CI/CD, I will take care of that. Edit: minify CI/CD step is now on dev

Khaoz-Topsy commented 1 year ago

Sweet 💪. I will join pico and simple-grid into the main.css file 😋

Lenni009 commented 1 year ago

Pico can be loaded with NPM and will automatically be included in the build without needing to manually put it into the repo

Lenni009 commented 1 year ago

npm install @picocss/pico

It can then be imported in the JS with import '@picocss/pico'; (at least that's what I do when using Vite)

Alternatively we could add a CI/CD step to download it from the CDN at build time

Khaoz-Topsy commented 1 year ago

I am not sure if that will work, we don't have the fancy bundler to handle that 🤔. I think you can import css/scss files from node_modules from inside a scss file 🤔.

Downloading from CDN is definitely possible, I just don't really see the benefit 😅. If those pico css peeps make a change to the styles, there wont be a broken build for breaking changes 😅. At least with npm packages you can pin the versions you hope will be stable and if the break something badly, you will get a broken build (hopefully).

Lenni009 commented 1 year ago

Pico V2 will have breaking changes, but we can just stick to a CDN with the V1 version

Lenni009 commented 1 year ago

CI/CD action is ready in case you don't get the scss stuff to work

Khaoz-Topsy commented 1 year ago

That is probably true, their repo has been quite lately (https://github.com/picocss/pico). Why do you want to use the file from the CDN though? Love of automation, wanting the latest changes or something else? 😂

I removed the generated files and added pico and simple-grid to the scss folder 😋. I removed your build step to add the nojekyl file in favour of putting the file in the public folder 😝

Khaoz-Topsy commented 1 year ago

Ah I see I need to combine your build steps to the way the scss files are handled 😝

Lenni009 commented 1 year ago

Love of automation

Mostly this, but I'm also of the opinion that anything that shouldn't be touched by humans also shouldn't be accessible to humans. The Pico peeps surely have thought something when they made the CSS. So when we don't include the file for the humans, we make sure that it stays functional. Same for .nojekyll. By not including it, we're making sure the humans don't mess with it. It also reduces download size by a whole 0 byte. Actually increases it by a few bytes because of the GitHub action haha. Anyway, the humans can't touch it. And when humans can't mess with something, they can't break it. And if something isn't broken, it most likely works.

Khaoz-Topsy commented 1 year ago

Ah yes, you make good point! Do you want to put those .nojekyll changes and the build step that downloads the css files back? Also you can add yourself to the humans section in site.json 😋

Lenni009 commented 1 year ago

So I can now officially say I'm a human? 😛

Lenni009 commented 1 year ago

How do you want to handle the SCSS files in the local dev env then? You can't dev without them I think, and I'm not too sure how to properly get them downloaded to your machine... Especially since Windows and Linux have different commands. I tried using CURL in Windows. In CMD, it just gives an error. In Powershell, it spits out the HTTP response, but only 8 lines of the actual SCSS content. The same command would've worked perfectly fine in Linux.

Lenni009 commented 1 year ago

I think adding automatic file downloads to the setup process on the dev side is a big pain (on the other hand it's super easy for the CI/CD). I therefore will only put the nojekyll file into the pipeline again.

Khaoz-Topsy commented 1 year ago

I added some automation for the downloading of third party scss files. The simple grid css file comes with a bunch of styles for the body that I don't want, so skipped it and only the pico css is automated for now 😝