Skip to content

Dash automatically includes SCSS files in the asset folder as stylesheets in the html head #1684

Closed

Description

@MrRikkert

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

dash                      1.20.0
dash-bootstrap-components 0.12.3a1
dash-core-components      1.16.0
dash-html-components      1.1.3
dash-renderer             1.9.1
dash-table                4.11.3
  • if frontend related, tell us your Browser, Version and OS

    • Not frontend related

Describe the bug

When there are .scss files in the assets folder, Dash will link these files in the html file as css files. This is an example of what Dash is linking now

<link rel="stylesheet" href="/assets/style.scss?m=1625666161.599422">
<link rel="stylesheet" href="/assets/dist/_functions.scss?m=1625656854.6298916">
<link rel="stylesheet" href="/assets/dist/_mixins.scss?m=1625666146.3466384">
<link rel="stylesheet" href="/assets/dist/_variabless.scss?m=1625666140.98121">
<link rel="stylesheet" href="/assets/dist/style.css?m=1625666162.0801146">

Expected behavior

Dash should ignore .scss files and don't put them in the html file. It should only link the following

<link rel="stylesheet" href="/assets/dist/style.css?m=1625666162.0801146">

I would guess the issue lies in the _on_assets_change and the _walk_assets_directory functions. These functions look for css in the following manner

filename.endswith("css")

and should probably be replaced by

filename.endswith(".css")

Activity

  1. self-assigned this
    on Jul 18, 2024
  2. removed their assignment
    on Aug 2, 2024
  3. changed the title [-][BUG] Dash automatically includes scss files in the asset folder as stylesheets in the html head[/-] [+]Dash automatically includes SCSS files in the asset folder as stylesheets in the html head[/+] on Aug 13, 2024
  4. added a commit that references this issue on Nov 10, 2026
    16b9f10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions