Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practice for CSS? #55

Closed
AlecRust opened this issue Oct 2, 2019 · 3 comments · Fixed by #57
Closed

Best practice for CSS? #55

AlecRust opened this issue Oct 2, 2019 · 3 comments · Fixed by #57
Labels
bug Something isn't working

Comments

@AlecRust
Copy link

AlecRust commented Oct 2, 2019

I have a component structure like so:

- /app
  - /components
    - /alert
      - alert.css
      - alert.html.erb
      - alert.rb

I'm importing the CSS file in Webpacker's application.css.

Unfortunately this setup gives me the error:

More than one template found for Alert. There can only be one sidecar template file per component.

I'm currently working around this by using _alert.css instead of alert.css, but it seems odd actionview-component is treating this CSS file as a template file?

Is there a best practice here I should be following? Or is this an issue actionview-component should fix?

@joelhawksley
Copy link
Member

@AlecRust you're right, actionview-component should only raise an error if there is more than one template file. It shouldn't care if there is a sidecar CSS file.

@joelhawksley joelhawksley added the bug Something isn't working label Oct 2, 2019
joelhawksley added a commit that referenced this issue Oct 2, 2019
@joelhawksley
Copy link
Member

@AlecRust can you check your app against v1.3.3 to see if this is fixed for you?

@AlecRust
Copy link
Author

AlecRust commented Oct 3, 2019

@joelhawksley works great, many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants