Incorrect CSS path resolution in components subdirectories

Created on 12 August 2023, 11 months ago

Problem/Motivation

When a component is not declared right below (theme)/components/ its CSS file is not detected, at least in storybook

Steps to reproduce

  • Enable cl_server; set up storybook
  • Create a custom theme
  • Create a component components/foo/, with its foo.component.yml, foo.twig, and foo.css
  • Create a component components/atoms/bar/, with its bar.component.yml, bar.twig, and bar.css
  • Examine foo: the CSS is loaded without error, from (site)/themes/(theme)/components/foo/foo.css : and it applies normally
  • Examine bar: the CSS is not loaded, getting a 404 from (site)/themes/(theme)/components/bar/bar.css
  • Manually visit (site)/themes/(theme)/components/atoms/bar/bar.css instead: the CSS can be loaded from there

Proposed resolution

TBD: either make sure the path to fetch the CSS is modified, or the resolver finds the file regardless of nested path. The latter seems to be more in line with SDC in general.

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France fgm Paris, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024