Shared custom css file between two sites?

This is most likely one of those “why?” situations, but I’m curious.

I’ve two sites, almost identical, both use quite a bit of custom CSS. Instead of having to open both projects when making changes to custom CSS I’m thinking of a single shared custom CSS file.

I’m thinking I just need to reference it in the “head” part of the site code, and jobs a goodun.

Does anyone think this will/won’t work?

Of course it will work. You e just made your own little CDN.

Half the world run their sites from entire frameworks like this.

A better way would be to have a build process that pulled in the file from a git repo and wrote it to each static site but given that this is RW related I’ll not mention it further.

1 Like

Now that sounds interesting. I’m not a big user of github, but it’s something I really need to get my head around.

Doesn’t have to be GitHub. If you want it private and free then BitBucket may be better for personal use.

You just need to be careful that you don’t make things more complicated than required if it is just to do something simple.

(See me after school)

Bear in mind that if you use css variables in your style sheet instead of font names, sizes, colours etc. then you can have a common style sheet for sites that look quite different from each other. Frameworks like F6 and Source are already using variables (I made myself a cheat-sheet mapping the variable names to Source‘s site styles panel, with its colour wells). This way your style-sheet will pick up on whatever colours etc. that you have set in site styles.

You could also use your own source cdn site and add a Repo stack there. With the inbuilt code editor you are able to do changes quickly in the source CSS file.

From memory I started to do this a few years back, putting all fonts etc. in it, but ran into issues, can’t recall what.

I will defo revisit this idea though, as with the new direction I’m taking with my web business it makes sense and should be far easier.