mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-22 02:41:23 +02:00
Allow setting custom CSS classes for individual widgets
This commit is contained in:
parent
b327e59ab1
commit
4dbb5975c0
@ -235,6 +235,8 @@ theme:
|
|||||||
> .widget-type-rss a {
|
> .widget-type-rss a {
|
||||||
> font-size: 1.5rem;
|
> font-size: 1.5rem;
|
||||||
> }
|
> }
|
||||||
|
>
|
||||||
|
> In addition, you can also use the `css-class` property which is available on every widget to set custom class names for individual widgets.
|
||||||
|
|
||||||
|
|
||||||
## Pages & Columns
|
## Pages & Columns
|
||||||
@ -356,6 +358,7 @@ pages:
|
|||||||
| type | string | yes |
|
| type | string | yes |
|
||||||
| title | string | no |
|
| title | string | no |
|
||||||
| cache | string | no |
|
| cache | string | no |
|
||||||
|
| css-class | string | no |
|
||||||
|
|
||||||
#### `type`
|
#### `type`
|
||||||
Used to specify the widget.
|
Used to specify the widget.
|
||||||
@ -377,6 +380,9 @@ cache: 1d # 1 day
|
|||||||
>
|
>
|
||||||
> Not all widgets can have their cache duration modified. The calendar and weather widgets update on the hour and this cannot be changed.
|
> Not all widgets can have their cache duration modified. The calendar and weather widgets update on the hour and this cannot be changed.
|
||||||
|
|
||||||
|
#### `css-class`
|
||||||
|
Set custom CSS classes for the specific widget instance.
|
||||||
|
|
||||||
### RSS
|
### RSS
|
||||||
Display a list of articles from multiple RSS feeds.
|
Display a list of articles from multiple RSS feeds.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="widget widget-type-{{ .GetType }}">
|
<div class="widget widget-type-{{ .GetType }}{{ if ne "" .CSSClass }} {{ .CSSClass }}{{ end }}">
|
||||||
<div class="widget-header">
|
<div class="widget-header">
|
||||||
<div class="uppercase">{{ .Title }}</div>
|
<div class="uppercase">{{ .Title }}</div>
|
||||||
{{ if and .Error .ContentAvailable }}
|
{{ if and .Error .ContentAvailable }}
|
||||||
|
@ -119,6 +119,7 @@ const (
|
|||||||
type widgetBase struct {
|
type widgetBase struct {
|
||||||
Type string `yaml:"type"`
|
Type string `yaml:"type"`
|
||||||
Title string `yaml:"title"`
|
Title string `yaml:"title"`
|
||||||
|
CSSClass string `yaml:"css-class"`
|
||||||
CustomCacheDuration DurationField `yaml:"cache"`
|
CustomCacheDuration DurationField `yaml:"cache"`
|
||||||
ContentAvailable bool `yaml:"-"`
|
ContentAvailable bool `yaml:"-"`
|
||||||
Error error `yaml:"-"`
|
Error error `yaml:"-"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user