Jieiku / abridge

Fast & Lightweight Zola Theme
https://abridge.pages.dev/
MIT License
147 stars 41 forks source link

Allow appending font-family with user input #113

Closed eugenesvk closed 1 year ago

eugenesvk commented 1 year ago

This adds the font extension partial style that allows users to append their fonts to the default font-family styles and an example file. Didn't find anything in the docs re. extending Abridge, so documented the use this example file _font-extend-COPY-ME.sass that the user is supposed to copy to his main repo, but it still needs to be mentioned somewhere

(also fixed the ~octuplicate appearance of the variables' root rules)

this still duplicates the --ff/--fm rules (once in user generated css, another time in abridge theme's generated css, user css wins), but then the alternative is might be too tricky to be worth it (the imports are order-sensitive, you'd first need to import the font override and only then import the main theme since you can't @use import the main them after using some functions to override the variables; and then the user would also need to explicitly disable the import of the main abridge.css in config)

Jieiku commented 1 year ago

This is great, thanks very much for doing this.

needs to be mentioned somewhere

The entire README for abridge will be getting redone before the Refactor branch gets merged, I will includes notes there.

(also fixed the ~octuplicate appearance of the variables' root rules)

Was that because I did the @use varaibles at the top of the auto/light/dark files? I did see you changed those to forwards which looks nice. I thought @use was supposed to prevent duplicates but maybe I misunderstood when I was reading the sass documentation.

this still duplicates the --ff/--fm rules

Good to know, if I think of any clean and simple way of preventing the duplicates then I will be sure to mention it.

eugenesvk commented 1 year ago

Was that because I did the @use varaibles at the top of the auto/light/dark files?

no, just because the variables had :root rule instead of wrapping it in mixin. I was surprised myself re why there are so many dupes since I thought I fixed it (and also had exactly this thought "isn't @use supposed to solve the dupe issue?", but then realized that the fixing commit was in a different branch :)

The change to forwards was just to avoid having any root rules in the main imports file

Good to know, if I think of any clean and simple way of preventing the duplicates then I will be sure to mention it.

Well, the user could always edit your theme directly instead of moving the file to his site, but that's also not very clean, think it's nicer to keep the theme as is and extend it elsewhere.

Otherwise you could use templates once you add them :) Then the user could just use configs to add fonts, that might be clean

Jieiku commented 1 year ago

Well, the user could always edit your theme directly instead of moving the file to his site, but that's also not very clean, think it's nicer to keep the theme as is and extend it elsewhere.

I absolutely agree, I would prefer for users to never need to edit Abridge directly. There have been more than a few questions about how to override this or that without editing the theme files directly, documentation for this will certainly be a focal point when I redo the README.

Otherwise you could use templates once you add them :) Then the user could just use configs to add fonts, that might be clean

Yes, being able to configure everything in config.toml would make using Zola much simpler I think, especially for non developers.