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

Inline styles #395

Open
stsewd opened this issue Jun 20, 2024 · 2 comments
Open

Inline styles #395

stsewd opened this issue Jun 20, 2024 · 2 comments
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@stsewd
Copy link
Member

stsewd commented Jun 20, 2024

I'm in the process of adding a strict content security policy. I'm going to use this issue to list inline styles, maybe other inlines I find.

<i class="fad fa-bars large icon" style="--fa-secondary-opacity: 0.8;"></i>

Actually, there are a couple of inline styles, just grepping for style= over html files returns lots of results, is that on purpose or just templates that we still need to migrate?

rg 'style=' **/*.html
@agjohnson
Copy link
Contributor

Ah yes, good catch, I didn't think about removing these as part of the CSP work.

We probably have a couple versions of this inline style:

  • display: none for when a KO element needs to start off hidden. I've since been using the CSS classes ko hidden instead, but this does take flipping some of the observable logic.
  • There are a few icons tuned for display with FA rules. These could be custom CSS classes instead, or maybe FA has a newer approach. In some cases, we might just override .fad.fa-bars with the --fa-secondary-opacity var/rule.

@agjohnson agjohnson added this to the Deprecation and cleanup milestone Jun 28, 2024
@agjohnson agjohnson added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Jun 28, 2024
@agjohnson
Copy link
Contributor

Bumping this up to this current milestone so we can make the CSP stricter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

2 participants