Ability to specify link media attribute
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
For accessibility and performance it would be good to have a way to specify the media attribute for the generated CSS.
I mean that all the
<link rel="stylesheet" href="_app/index.012930190.css">
could be actually something like
<link rel="stylesheet" href="_app/index.012930190.css" media="screen">
thus many screen or braille readers, etc., could avoid downloading the stylesheets.
Describe the proposed solution
I'm not sure what a good a good solution would be but I guess I would prefer having a default media="screen" if nothing specified and maybe the ability in sfc files to do something like:
<style media="screen"> <!-- or print etc. -->
</style>
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how generated CSS link elements are produced and how SFC style attributes are represented; the issue names no files or tests. Confirm the intended default and configuration behavior, then verify that generated stylesheet links can carry the requested media value without affecting existing output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- accessibility, frontend, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100