dashy icon indicating copy to clipboard operation
dashy copied to clipboard

[BUG] Custom CSS cannot be applied.

Open 94tiger opened this issue 1 year ago • 15 comments

Environment

Self-Hosted (Docker)

System

Docker

Version

2.1.1

Describe the problem

style.css

@font-face {
  font-family: "NanumBarunpenB";
  src: url("/fonts/NanumBarunpenB.ttf");
}

conf.yaml

appConfig:
  externalStyleSheet: ['/assets/style.css']

I saved the above to a file. And applied like. --font-body: "NanumBarunpenB", serif; However, css was not applied, and when the same content written in style.css was applied in the UI, it was applied. This is not permanently applied, but only applied temporarily when the 'Save Changes' button is pressed, and restored when refreshing.

image

css applied after pressing 'Save Changes' button

image

Additional info

No response

Please tick the boxes

94tiger avatar Aug 22 '23 02:08 94tiger

If you're enjoying Dashy, consider dropping us a ⭐
🤖 I'm a bot, and this message was automated

liss-bot avatar Aug 22 '23 02:08 liss-bot

This issue has gone 3 months without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Nov 21 '23 01:11 liss-bot

This issue was automatically closed because it has been stalled for over 6 weeks with no activity.

liss-bot avatar Nov 26 '23 01:11 liss-bot

can confirm, something there is either broken or the documentation outdated, to less detailed.

CrazyWolf13 avatar Dec 28 '23 17:12 CrazyWolf13

@lopiv2 CC'ing your ticket, #1242 into here.

Lissy93 avatar Dec 31 '23 21:12 Lissy93

seem to have this issue as well I think its done correctly so this is my docker:

  - /var/local/dashy/gruvbox.scss:/app/src/styles/user-defined-themes.scss

My scss file:

html[data-theme='gruvbox'] {
  --primary: #d79921;
  --background: #282828;
  --background-darker: #3c3836;
  --item-group-background: #504945;
  --item-background: var(--background);
  --item-background-hover: var(--background-darker);
  --item-hover-shadow: 0 1px 3px #d79921b3, 0 1px 2px #d79921bf;
  --font-body: 'Cascadia Code', 'Fira Code', monospace;
  --font-headings: 'Source Han Serif VF', 'Georgia', serif;
  --text-color: #ebdbb2;
  --text-color-subtle: #bdae93;
  --border-color: #7c6f64;
  --notification-bg: #cc241d;
  --modal-bg: #3c3836;
  --button-bg: #98971a;
  --button-text: #282828;
}

and finally the appConfig

appConfig:
  theme: gruvbox
  cssThemes:
    - gruvbox
  customCss: >-
    @media (min-width: 1780px) { .home
    .item-group-container:not(.item-size-large) { grid-template-columns:
    repeat(3, 1fr); } } .home .item-group-container.item-size-large
    .item-group-grid, .home .item-group-container.orientation-vertical
    .item-group-grid { display: flex !important; }
  auth:
    enableGuestAccess: true

codevski avatar Feb 26 '24 08:02 codevski

Hi This problems seems to be related to dashy not automatically rebuilding on changes, see #1479 and https://github.com/Lissy93/dashy/issues/1290#issuecomment-1884249018 A new release has just been published, which should fix this issue, so please upgrade to the latest version. If this is not the case just respond back to this ticket and I'll reopen this issue. Thanks and have a nice day.

CrazyWolf13 avatar Mar 03 '24 17:03 CrazyWolf13

I'm having a similar issue, when I change to my custom theme and reload the page the colors are still blue, here's screenshots:

First one: 1 after changing from default to custom 2 and second one is after reloading my tab, I could be doing something wrong though, I have tried rebuilding with the theme on but it just goes blue

EliasGagnef avatar Mar 09 '24 23:03 EliasGagnef

Oh interesting, @EliasGagnef - how did you make your theme, was it a custom stylesheet, or just setting custom colors?

I'm guessing that it could be appConfig.customColors isn't being saved correctly. Do you mind sharing that part of your conf.yml with me?

Also, that is a sick dashboard, I love it! 😍

Lissy93 avatar Mar 10 '24 15:03 Lissy93

Oh interesting, @EliasGagnef - how did you make your theme, was it a custom stylesheet, or just setting custom colors?

I'm guessing that it could be appConfig.customColors isn't being saved correctly. Do you mind sharing that part of your conf.yml with me?

Also, that is a sick dashboard, I love it! 😍

Thank you so much :D

I set the custom colors in the UI, but I have also edited the dashy_conf.yml, I probably did something wrong :p

I'm not sure what part so I'll just send the whole file here it is:

appConfig:
  backgroundImg: https://i.imgur.com/oErxY4Z.jpg
  theme: custom
  layout: auto
  iconSize: large
  language: sv
  startingView: default
  defaultOpeningMethod: newtab
  statusCheck: false
  statusCheckInterval: 0
  faviconApi: allesedv
  routingMode: history
  enableMultiTasking: false
  widgetsAlwaysUseProxy: false
  webSearch:
    disableWebSearch: false
    searchEngine: duckduckgo
    openingMethod: newtab
    searchBangs: {}
  enableFontAwesome: true
  enableMaterialDesignIcons: false
  hideComponents:
    hideHeading: false
    hideNav: false
    hideSearch: false
    hideSettings: false
    hideFooter: false
  auth:
    enableGuestAccess: false
    users: []
    enableKeycloak: false
  showSplashScreen: false
  preventWriteToDisk: false
  preventLocalSave: false
  disableConfiguration: false
  disableConfigurationForNonAdmin: false
  allowConfigEdit: true
  enableServiceWorker: false
  disableContextMenu: false
  disableUpdateChecks: false
  disableSmartSort: false
  enableErrorReporting: false
  customColors:
    custom:
      primary: '#ebb75c'
      background: '#2d2200'
      background-darker: '#130d00'
pageInfo:
  title: Cayuga
  description: ''
  navLinks: []
  footerText: ''
sections:
  - name: Media
    icon: hl-duckdns
    displayData:
      sortBy: default
      rows: 1
      cols: 1
      collapsed: false
      hideForGuests: false
    items:
      - title: Jellyfin
        icon: hl-jellyfin
        url: http://localhost:8096/web/index.html#!/home.html
        id: 0_480_jellyfin
      - title: Qbittorrent
        icon: hl-qbittorrent
        url: http://192.168.1.21:8080/
        target: null
        id: 1_480_qbittorrent
      - title: Sonarr
        icon: hl-sonarr
        url: http://192.168.1.21:8989/
        target: null
        id: 2_480_sonarr
      - title: Radarr
        icon: hl-radarr
        url: http://192.168.1.21:7878/
        target: null
        id: 3_480_radarr
      - title: Bazarr
        icon: hl-bazarr
        url: http://192.168.1.21:6767/series
        target: null
        id: 4_480_bazarr
      - title: Prowlarr
        icon: hl-prowlarr
        url: http://192.168.1.21:9696/
        target: null
        id: 5_480_prowlarr
  - name: Admin
    icon: hl-jellystat
    displayData:
      sortBy: default
      rows: 1
      cols: 1
      collapsed: false
      hideForGuests: false
    items:
      - title: Cockpit
        icon: hl-cockpit
        url: https://192.168.1.21:9090/
        target: null
        id: 0_489_cockpit
      - title: Portainer
        icon: hl-portainer
        url: https://192.168.1.21:9443/#!/2/docker/dashboard
        target: null
        id: 1_489_portainer
  - name: wiidget
    widgets:
      - type: gluetun-status
        useProxy: true
        options:
          hostname: http://localhost:8000
          visibleFields: >-
            public_ip,region,country,city,location,organisation,postal_code,timezone
        id: 0_749_gluetunstatus
      - type: image
        options:
          imagePath: https://i.imgur.com/VoVqUld.gif
        id: 1_749_image

EliasGagnef avatar Mar 10 '24 17:03 EliasGagnef

Thanks :)

This is indeed a bug, so I'll re-open.

As a workaround, your config works fine if you set the theme to default and then also put your colors under default (instead of custom). This will also work using any other theme as the base theme (except custom).

appConfig:
  # .....
  customCss: '.settings-outer { background: transparent !important; }'
  customColors:
    default:
      primary: '#ebb75c'
      background: '#2d2200'
      background-darker: '#130d00'
      settings-background: 'transparent'

Lissy93 avatar Mar 10 '24 19:03 Lissy93

Thanks :)

This is indeed a bug, so I'll re-open.

As a workaround, your config works fine if you set the theme to default and then also put your colors under default (instead of custom). This will also work using any other theme as the base theme (except custom).

appConfig:
  # .....
  customCss: '.settings-outer { background: transparent !important; }'
  customColors:
    default:
      primary: '#ebb75c'
      background: '#2d2200'
      background-darker: '#130d00'
      settings-background: 'transparent'

Thank you, I put the colors under "bee" since that one has the fonts I like :D (also fits perfectly with Adventure Time), works perfectly!!

Also thank you so much for making Dashy, it really makes using my computer/server much more fun :)

EliasGagnef avatar Mar 11 '24 00:03 EliasGagnef

I have also had a little issue getting a user-defined-themes.scss live. Its mounted inside the container fine. I've added the appsConfig.cssThemes to add it to the dropdown. But all the css is still the default theme, even when switching between themes. I docker exec'd into the container and ran yarn build and my new css theme sprang to life. Looks like the addition/change to this file isn't causing a rebuild even on container restart, should it?

the1ts avatar Apr 29 '24 10:04 the1ts

@the1ts Could you test this again with re-pulling the :latest tag? That should actually be resolved.

CrazyWolf13 avatar May 10 '24 22:05 CrazyWolf13

Confirmed it builds by:

  1. blanking my user-defined-themes.scss restarting and theme not present
  2. putting theme file back in place, restarting, I see checking, then building and the theme appears.

Thanks again.

the1ts avatar May 11 '24 11:05 the1ts

@the1ts Is this issue still persistent with the :latest tag?

I cannot reproduce this here.

CrazyWolf13 avatar Aug 07 '24 11:08 CrazyWolf13

@CrazyWolf13 like you, I believe this problem is fixed, my custom CSS is working fine now. I was able to remove the file, restart. Then put the file back in and restart and no manual intervention was required and I can confirm I'm still at :latest.

the1ts avatar Aug 07 '24 11:08 the1ts