mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-03 12:12:39 +00:00
17d7bc1781
* feat(assets): refactor SCSS variables with Hugo config via hugo:vars Use Hugo's hugo:vars mechanism (v0.161.0+) to configure SCSS variables via [params.appearance] in hugo.toml, replacing the override.scss file. - Add [params.appearance] config section in hugo.toml - Create scss-vars.html partial for SCSS default values - Pass vars to toCSS via head/index.html - Rewrite _variables.scss to use @use "hugo:vars" as h with !default - Update all 20 consumer files from @use "override" to @use "variables" - Delete override.scss - Add admonition mixin in core/mixins/_admonition.scss - Update deprecation detection to use fileExists * refactor(assets): standardize module setup() and simplify main.ts init - Add setup() method to all modules (menu, theme, search, enc, misc, events) - Rename initMenu to setup, initMenuDesktop/initMenuMobile to initDesktop/initMobile - Rename initSearch, initFixItDecryptor to setup - Standardize setup() position at end of each module class and interface - Simplify main.ts init sequence to uniform setup() calls * refactor(assets): replace config.template.scss with hugo:vars/internal - Delete config.template.scss and its ExecuteAsTemplate pipeline - Pass internal config (base URL, logo, loading) via hugo:vars/internal namespace - Move CSS custom properties to _root.scss using set-fi-vars mixin - Simplify _variables.scss by removing config namespace dependency - Update CLAUDE.md to reflect new SCSS architecture * style(i18n): fix spacing in Korean translation strings * fix(assets): resolve dead SCSS config keys and deduplicate defaults - Wire up 5 config keys with v.$ references: menu-active-color, tag-cloud-start, tag-cloud-end, tag-cloud-end-dark, pagination-link-color-dark (were reading from SCSS vars, ignoring hugo:vars overrides) - Remove dead !default flags from all v.$ references (hugo:vars always provides values, making !default unreachable) - Compute derived defaults in scss-vars.html from base values instead of hardcoding duplicates - Extract admonition mixin set-fi-vars map to shared $vars variable
90 lines
3.6 KiB
HTML
90 lines
3.6 KiB
HTML
{{- /*
|
|
SCSS variables default values.
|
|
Merged with user config ([params.appearance]) and passed to toCSS as hugo:vars.
|
|
Values from: assets/scss/_variables.scss
|
|
Note: Color values must use hex format (e.g. "#ff0000"), CSS named colors (e.g. "red") are not supported
|
|
because Hugo's isTypedCSSValue only recognizes hex colors, CSS functions, and CSS units.
|
|
*/ -}}
|
|
{{- /* Base defaults — independent values */ -}}
|
|
{{- $defaults := dict
|
|
"global_font_family" "system-ui, -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft YaHei UI, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, Helvetica, Arial, sans-serif"
|
|
"global_font_size" "16px"
|
|
"global_font_weight" "400"
|
|
"global_line_height" "1.5rem"
|
|
"global_border_radius" "6px"
|
|
"global_background_color" "#ffffff"
|
|
"global_background_color_dark" "#1f252d"
|
|
"global_font_color" "#1f2328"
|
|
"global_font_color_dark" "#b3bdcb"
|
|
"global_font_secondary_color" "#8b949e"
|
|
"global_font_secondary_color_dark" "#7d8792"
|
|
"global_link_color" "#161209"
|
|
"global_link_color_dark" "#b3bdcb"
|
|
"global_link_hover_color" "#2983bb"
|
|
"global_link_hover_color_dark" "#fff"
|
|
"global_border_color" "#d7dee4"
|
|
"global_border_color_dark" "#383f47"
|
|
"scrollbar_color" "#a6a6a6"
|
|
"scrollbar_hover_color" "#7d7d7d"
|
|
"selection_color" "rgba(53, 166, 247, 0.25)"
|
|
"selection_color_dark" "rgba(50, 112, 194, 0.4)"
|
|
"header_height" "3.5rem"
|
|
"header_background_color" "#f6f8fa"
|
|
"header_background_color_dark" "#151b23"
|
|
"header_title_font_size" "1.375rem"
|
|
"menu_active_color_dark" "#fff"
|
|
"menu_border_color" "#3c3c3c1f"
|
|
"menu_border_color_dark" "#5454547a"
|
|
"search_background_color" "#e9eaed"
|
|
"search_background_color_dark" "#202833"
|
|
"tag_cloud_start_dark" "#909092"
|
|
"toc_title_font_size" "1rem"
|
|
"toc_content_font_size" "0.875rem"
|
|
"collection_title_font_size" "1rem"
|
|
"collection_list_font_size" "0.875rem"
|
|
"related_title_font_size" "1rem"
|
|
"related_list_font_size" "0.875rem"
|
|
"single_link_color" "#2376b7"
|
|
"single_link_color_dark" "#1781b5"
|
|
"single_link_hover_color" "#ea517f"
|
|
"single_link_hover_color_dark" "#cc5595"
|
|
"table_background_color" "#f9fbfe"
|
|
"table_background_color_dark" "#26303a"
|
|
"table_thead_color" "#e3ebf4"
|
|
"table_thead_color_dark" "#3a4653"
|
|
"table_border_color" "#d4dee8"
|
|
"table_border_color_dark" "#4b5867"
|
|
"blockquote_color" "#697681"
|
|
"blockquote_color_dark" "#9ba3aa"
|
|
"reward_color" "#ff6347"
|
|
"reward_img_width" "180px"
|
|
"pagination_link_color" "#bfbfbf"
|
|
"pagination_link_hover_color" "#000"
|
|
"pagination_link_hover_color_dark" "#fff"
|
|
"code_color" "#26323d"
|
|
"code_color_dark" "#c5d1dc"
|
|
"code_header_color" "#70808f"
|
|
"code_header_color_dark" "#99a7b5"
|
|
"code_header_background_color" "#dde6ef"
|
|
"code_header_background_color_dark" "#161f28"
|
|
"code_background_color" "#f3f7fb"
|
|
"code_background_color_dark" "#2a333d"
|
|
"code_error_color" "#dc3545"
|
|
"code_highlight_color" "#fff2b8"
|
|
"code_highlight_color_dark" "rgba(191, 144, 32, 0.28)"
|
|
"code_font_size" "0.875em"
|
|
"code_block_font_size" "0.875rem"
|
|
"github_corner_color" "#ffffff"
|
|
"github_corner_color_dark" "#000000"
|
|
-}}
|
|
{{- /* Derived defaults — values that follow other keys (see _variables.scss) */ -}}
|
|
{{- $derived := dict
|
|
"menu_active_color" (index $defaults "global_link_color")
|
|
"tag_cloud_start" (index $defaults "global_font_color_dark")
|
|
"tag_cloud_end" (index $defaults "global_font_color")
|
|
"tag_cloud_end_dark" (index $defaults "global_font_color_dark")
|
|
"pagination_link_color_dark" (index $defaults "global_font_color_dark")
|
|
-}}
|
|
{{- $defaults = merge $defaults $derived -}}
|
|
{{- return $defaults -}}
|