-
Notifications
You must be signed in to change notification settings - Fork 27
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
Question: changing icon color(s) or font #27
Comments
This is something I'm working on documenting better. You can override any of the CSS custom properties in an If you want to change your whole theme's primary color in one go, set a Global property override: /* Light AND dark theme override */
:root, [data-theme="dark"] {
--color-primary: green;
}
/* Separate overrides for light and dark */
:root {
--color-primary: green;
}
[data-theme="dark"] {
--color-primary: red;
} For individual elements that don't have a property, find their class in the source code or browser and override that. Those buttons in the image, for example, have classes .hero-info .btn-primary {
background-color: green;
border-color: green;
}
.hero-info .btn-secondary {
color: green;
border-color: green;
} Because CSS is ubiquitous, I felt it was easier just using CSS for these types of changes rather than trying to support a million different style preferences via configs. Something you just made me realize is that in development the custom CSS file was linked before the compiled source Sass, and therefore the cascade wasn't picking up some custom CSS changes. I just fixed that in the version I released a minute ago (v3.3.0). This only impacted custom CSS in development because in prod the custom CSS was bundled with the source CSS in the correct order. Icons use As for fonts, I didn't expose those as CSS properties yet, just the font sizes. This is because the theme uses local fonts and doesn't load them from a CDN which makes the process a little more difficult. You can however customize fonts by adding the files to Single font-face declaration, in practice you'd have 1 for each font style: @font-face {
font-family: 'Montserrat';
src: local('Montserrat Thin'),
url('/fonts/Montserrat/Montserrat-Thin.ttf') format('truetype');
font-weight: 100;
font-style: normal;
font-display: swap;
} Then in your body {
font: normal 125%/1.4 "Montserrat", "Helvetica Neue Light", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
} Apologies for the long-winded answer. I'm going to work on documenting this better and improving some of these customization workflows. |
Okay thank you, I appreciate the detailed answer! I agree with your thoughts on allowing user to extend colors directly via CSS. Sounds good on changing fonts. Feel free to close this out whenever you're ready |
My pleasure; it's helpful getting feedback like this |
Is there a config parameter for changing icon colors and/or font?
I was looking at the config
exampleSite/config/_default/hugo.toml
, and I didn't see any fields for specifying overrides on these.The text was updated successfully, but these errors were encountered: