mirror of
https://github.com/imfing/hextra.git
synced 2025-05-12 23:46:45 -04:00
Compare commits
6 Commits
2fc1b93a72
...
6b7a77ab14
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6b7a77ab14 | ||
![]() |
655148f329 | ||
![]() |
b6d14afca3 | ||
![]() |
da56d153aa | ||
![]() |
5c0698c3c0 | ||
![]() |
ebdaf0fd4a |
@ -44,6 +44,128 @@ The primary color of the theme can be customized by setting the `--primary-hue`,
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Further Theme Customization
|
||||||
|
|
||||||
|
The theme can be further customized by overriding the default styles via the exposed css classes. An example for customizing the footer element:
|
||||||
|
|
||||||
|
```css {filename="assets/css/custom.css"}
|
||||||
|
.hextra-footer {
|
||||||
|
/* Styles will be applied to the footer element */
|
||||||
|
}
|
||||||
|
|
||||||
|
.hextra-footer:is(html[class~="dark"] *) {
|
||||||
|
/* Styles will be applied to the footer element in dark mode */
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
The following classes can be used to customize various parts of the theme.
|
||||||
|
|
||||||
|
#### General
|
||||||
|
|
||||||
|
- `hextra-scrollbar` - The scrollbar element
|
||||||
|
- `content` - Page content container
|
||||||
|
|
||||||
|
#### Shortcodes
|
||||||
|
|
||||||
|
##### Badge
|
||||||
|
|
||||||
|
- `hextra-badge` - The badge element
|
||||||
|
|
||||||
|
##### Card
|
||||||
|
|
||||||
|
- `hextra-card` - The card element
|
||||||
|
- `hextra-card-image` - The card image element
|
||||||
|
- `hextra-card-icon` - The card icon element
|
||||||
|
- `hextra-card-subtitle` - The card subtitle element
|
||||||
|
|
||||||
|
##### Cards
|
||||||
|
|
||||||
|
- `hextra-cards` - The cards grid container
|
||||||
|
|
||||||
|
##### Jupyter Notebook
|
||||||
|
|
||||||
|
- `hextra-jupyter-code-cell` - The Jupyter code cell container
|
||||||
|
- `hextra-jupyter-code-cell-outputs-container` - The Jupyter code cell outputs container
|
||||||
|
- `hextra-jupyter-code-cell-outputs` - The Jupyter code cell output div element
|
||||||
|
|
||||||
|
##### PDF
|
||||||
|
|
||||||
|
- `hextra-pdf` - The PDF container element
|
||||||
|
|
||||||
|
##### Steps
|
||||||
|
|
||||||
|
- `steps` - The steps container
|
||||||
|
|
||||||
|
##### Tabs
|
||||||
|
|
||||||
|
- `hextra-tabs-panel` - The tabs panel container
|
||||||
|
- `hextra-tabs-toggle` - The tabs toggle button
|
||||||
|
|
||||||
|
##### Filetree
|
||||||
|
|
||||||
|
- `hextra-filetree` - The filetree container
|
||||||
|
|
||||||
|
##### Folder
|
||||||
|
|
||||||
|
- `hextra-filetree-folder` - The filetree folder container
|
||||||
|
|
||||||
|
#### Navbar
|
||||||
|
|
||||||
|
- `nav-container` - The navbar container
|
||||||
|
- `nav-container-blur` - The navbar container in blur element
|
||||||
|
- `hamburger-menu` - The hamburger menu button
|
||||||
|
|
||||||
|
#### Footer
|
||||||
|
|
||||||
|
- `hextra-footer` - The footer element
|
||||||
|
|
||||||
|
#### Search
|
||||||
|
|
||||||
|
- `search-wrapper` - The search wrapper container
|
||||||
|
- `search-input` - The search input element
|
||||||
|
- `search-results` - The search results list container
|
||||||
|
|
||||||
|
#### Table of Contents
|
||||||
|
|
||||||
|
- `hextra-toc` - The table of contents container
|
||||||
|
|
||||||
|
#### Sidebar
|
||||||
|
|
||||||
|
- `mobile-menu-overlay` - The overlay element for the mobile menu
|
||||||
|
- `sidebar-container` - The sidebar container
|
||||||
|
- `sidebar-active-item` - The active item in the sidebar
|
||||||
|
|
||||||
|
#### Language Switcher
|
||||||
|
|
||||||
|
- `language-switcher` - The language switcher button
|
||||||
|
- `language-options` - The language options container
|
||||||
|
|
||||||
|
#### Theme Toggle
|
||||||
|
|
||||||
|
- `theme-toggle` - The theme toggle button
|
||||||
|
|
||||||
|
#### Cody Copy Button
|
||||||
|
|
||||||
|
- `hextra-code-copy-btn-container` - The code copy button container
|
||||||
|
- `hextra-code-copy-btn` - The code copy button
|
||||||
|
|
||||||
|
#### Code Block
|
||||||
|
|
||||||
|
- `hextra-code-block` - The code block container
|
||||||
|
|
||||||
|
#### Feature Card
|
||||||
|
|
||||||
|
- `hextra-feature-card` - The feature card link element
|
||||||
|
|
||||||
|
#### Feature Grid
|
||||||
|
|
||||||
|
- `hextra-feature-grid` - The feature grid container
|
||||||
|
|
||||||
|
#### Breadcrumbs
|
||||||
|
|
||||||
|
No specific class is available for breadcrumbs.
|
||||||
|
|
||||||
### Syntax Highlighting
|
### Syntax Highlighting
|
||||||
|
|
||||||
List of available syntax highlighting themes are available at [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html). The stylesheet can be generated using the command:
|
List of available syntax highlighting themes are available at [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html). The stylesheet can be generated using the command:
|
||||||
|
@ -95,7 +95,7 @@ Open source projects powered by Hextra
|
|||||||
>}}
|
>}}
|
||||||
|
|
||||||
{{< card
|
{{< card
|
||||||
link="https://lutheranconfessions.org/"
|
link="https://github.com/remysheppard/lutheran-confessions"
|
||||||
title="LutheranConfessions"
|
title="LutheranConfessions"
|
||||||
image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359"
|
image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359"
|
||||||
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
imageStyle="object-fit:cover; aspect-ratio:16/9;"
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
{{- range .Site.Menus.main -}}
|
{{- range .Site.Menus.main -}}
|
||||||
{{- if eq .Params.type "search" -}}
|
{{- if eq .Params.type "search" -}}
|
||||||
{{- partial "search.html" (dict "params" .Params) -}}
|
{{- partial "search.html" (dict "params" .Params) -}}
|
||||||
|
{{- else if eq .Params.type "theme-toggle" -}}
|
||||||
|
{{- partial "theme-toggle.html" (dict "navbar" true "hideLabel" (.Params.hideLabel | default true)) -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $link := .URL -}}
|
{{- $link := .URL -}}
|
||||||
{{- $external := strings.HasPrefix $link "http" -}}
|
{{- $external := strings.HasPrefix $link "http" -}}
|
||||||
@ -67,4 +69,4 @@
|
|||||||
{{- partial "utils/icon.html" (dict "name" "hamburger-menu" "attributes" "height=24") -}}
|
{{- partial "utils/icon.html" (dict "name" "hamburger-menu" "attributes" "height=24") -}}
|
||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
@ -1,3 +1,10 @@
|
|||||||
|
{{- $navbar := .navbar | default false -}}
|
||||||
|
{{- $height_px := 12 -}}
|
||||||
|
{{- $height_tw := "hx-text-xs" -}}
|
||||||
|
{{- if $navbar -}}
|
||||||
|
{{- $height_px = 24 -}}
|
||||||
|
{{- $height_tw = "hx-text-sm" -}}
|
||||||
|
{{- end -}}
|
||||||
{{- $hideLabel := .hideLabel | default false -}}
|
{{- $hideLabel := .hideLabel | default false -}}
|
||||||
|
|
||||||
{{- $changeTheme := (T "changeTheme") | default "Change theme" -}}
|
{{- $changeTheme := (T "changeTheme") | default "Change theme" -}}
|
||||||
@ -8,14 +15,14 @@
|
|||||||
<button
|
<button
|
||||||
title="{{ $changeTheme }}"
|
title="{{ $changeTheme }}"
|
||||||
data-theme="light"
|
data-theme="light"
|
||||||
class="theme-toggle hx-group hx-h-7 hx-rounded-md hx-px-2 hx-text-left hx-text-xs hx-font-medium hx-text-gray-600 hx-transition-colors dark:hx-text-gray-400 hover:hx-bg-gray-100 hover:hx-text-gray-900 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50"
|
class="theme-toggle hx-group hx-h-7 hx-rounded-md hx-px-2 hx-text-left {{ $height_tw }} hx-font-medium hx-text-gray-600 hx-transition-colors dark:hx-text-gray-400 hover:hx-bg-gray-100 hover:hx-text-gray-900 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50"
|
||||||
type="button"
|
type="button"
|
||||||
aria-label="{{ $changeTheme }}"
|
aria-label="{{ $changeTheme }}"
|
||||||
>
|
>
|
||||||
<div class="hx-flex hx-items-center hx-gap-2 hx-capitalize">
|
<div class="hx-flex hx-items-center hx-gap-2 hx-capitalize">
|
||||||
{{- partial "utils/icon.html" (dict "name" "sun" "attributes" "height=12 class=\"group-data-[theme=light]:hx-hidden\"") -}}
|
{{- partial "utils/icon.html" (dict "name" "sun" "attributes" (printf "height=%d class=\"group-data-[theme=light]:hx-hidden\"" $height_px)) -}}
|
||||||
{{- if not $hideLabel }}<span class="group-data-[theme=light]:hx-hidden">{{ $light }}</span>{{ end -}}
|
{{- if not $hideLabel }}<span class="group-data-[theme=light]:hx-hidden">{{ $light }}</span>{{ end -}}
|
||||||
{{- partial "utils/icon.html" (dict "name" "moon" "attributes" "height=12 class=\"group-data-[theme=dark]:hx-hidden\"") -}}
|
{{- partial "utils/icon.html" (dict "name" "moon" "attributes" (printf "height=%d class=\"group-data-[theme=dark]:hx-hidden\"" $height_px)) -}}
|
||||||
{{- if not $hideLabel }}<span class="group-data-[theme=dark]:hx-hidden">{{ $dark }}</span>{{ end -}}
|
{{- if not $hideLabel }}<span class="group-data-[theme=dark]:hx-hidden">{{ $dark }}</span>{{ end -}}
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user