Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move theme colours to a partial file for easy customization #48

AngeloStavrow opened this issue Jun 24, 2019 · 2 comments · Fixed by #58


Copy link

commented Jun 24, 2019

Is your feature request related to a problem? Please describe.
My personal site is powered by the Indigo theme, but with a different set of colours. This adds a fair bit of friction to the process of updating the theme when changes are made.

Describe the solution you'd like
Pull the colours out of static/css/style.css and move them to a file in partials, to make colour customization easy.

Describe alternatives you've considered

Additional context
We'll probably want to be able to conditionally pull in custom colour files so that if a custom colour file exists, we use it, and if not, we use a default colour file.


This comment has been minimized.

Copy link
Owner Author

commented Aug 30, 2019

Work on this is underway!

The current state of style.css is... gross. I'm not a CSS guru by any stretch of the imagination, but I've learned some since I created this theme, and I'd like to clean things up. That's outside the scope of this issue, but in the meanwhile here's the proposal for importing custom CSS.

Pulling in custom CSS

In layouts/partials/head.html, after linking to style.css, we check for static/css/custom.css:

<link rel="stylesheet" href="/css/style.css" />
{{ if (fileExists "/static/css/custom.css") -}}
<link rel="stylesheet" href="/css/custom.css" />
{{- end }}

Then, you can add static/css/custom.css to your Hugo site (NOT to themes/indigo/static/css!) with whatever additions/overrides you'd like. That way, you can continue to pull in updates to Indigo without breaking your custom CSS.

AngeloStavrow added a commit that referenced this issue Aug 30, 2019

This comment has been minimized.

Copy link
Owner Author

commented Aug 31, 2019

The way we're pulling in the font declarations as inline CSS (cf. #27) is polluting <head>, so —as part of the work on this issue— I've moved /layouts/partials/fonts.css to /static/css/fonts.css in 857860a so that it can be linked as a stylesheet instead.

This has the side benefit of removing a whole mess of {{ .Site.baseURL }} calls as part of #57 too.

@AngeloStavrow AngeloStavrow referenced this issue Aug 31, 2019
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.