This article introduces how to customize your hexo-theme-reimu for versions v1.0.0+ of the theme.
Dynamic Theme Color Adaptation (Experimental Feature in v1.7.0+)
Disabled by default. When enabled, it dynamically generates theme colors based on the dominant color of the article’s banner image, following Google’s Material You design guidelines.
1 | material_theme: |
Note: When this feature is enabled, the
crossorigin="anonymous"
attribute will be added to theimg
element of the banner to fetch the dominant color of the image. Please ensure your image server supports cross-origin access or use a third-party image proxy.
Manual Customizing Theme Colors
The hexo-theme-reimu theme supports customizing theme colors through CSS variables. You can modify the CSS variables under the :root
pseudo-class to customize your theme colors.
The variable file is located at source/css/_variables.styl
. While you can find all CSS variables in this file, you only need to modify the variables under the following pseudo-classes
v1.8.0 added internal_theme
configuration to customize theme colors. You can change the theme colors by modifying the internal_theme
configuration in params.yml
. The default theme colors are as follows:
1 | internal_theme: |
Customizing Fonts
You can define Google Fonts using the following configuration:
1 | # https://fonts.google.com/ |
In v1.1.0, the local_font
configuration was added to define local fonts, which have lower priority than Google Fonts:
1 | local_font: |
v1.8.0 added custom_font
configuration for defining custom fonts, which has the highest priority:
1 | custom_font: |
Customizing Icons
v1.0.0 underwent significant refactoring, exposing many configurations for users to modify the default icons.
Header / Sidebar Icons
The structure of the menu
configuration in v1.0.0 has changed, allowing users to customize icons. If the icon is left empty, the default Tai Chi icon will be used. You can fill in a hexadecimal number to customize the icon, supporting both FontAwesome and Icon Font.
1 | menu: |
Footer / Back-to-Top / Sponsor Icons
In v1.0.0, the footer
, top
, and sponsor
configurations have added an icon
configuration for customizing icons.
url
is the path to the icon, relative tocss/style.css
, so you need to go up one level to find theimages
folder.rotate
determines whether the icon should rotate, default istrue
.mask
determines whether the image should be used as a mask (i.e., only the outline of the PNG image is displayed), default istrue
.
v1.8.4 icon supports image path, such as /avatar/avatar.webp
.
1 | footer: |
Loading Icon
In v1.0.0, the preloader
configuration has added an icon
configuration for customizing the loading icon. If the icon is left empty, the default inline SVG will be used (to ensure fast initial loading). You can fill in a link to customize the loading icon.
It is not recommended to use overly large icons to avoid affecting loading speed.
1 | preloader: |
Anchor Icon
In v1.0.0, the anchor_icon
configuration was added to customize the anchor icon. By default, the #
icon is used. You can fill in a hexadecimal number to customize the icon, supporting both FontAwesome and Icon Font.
1 | anchor_icon: # Leave empty to use the default # icon |
v1.8.5 anchor_icon
supports passing false
to hide anchor icon.
Cursor Icon (v1.3.0+)
In v1.3.0, the reimu_cursor.cursor
configuration was added to customize the cursor icon. You can fill in a path relative to css/style.css
to customize the cursor icon.
1 | reimu_cursor: |
Leave a comment