I don't write much html these days. I'm a JS guy. So when I do and I have to include an external style sheet I always have to lookup the actual link syntax from another project or google. So annoying.
Legacy is nice, but forward thinking might be too. I don't really understand why we can't have
style tags. This can all be done in a perfectly backwards compatible way. Even the transition period can be quite elegantly fixed. Here's another one of my "wishful thinking" (tm) proposals...
Current (minimal) situation:
<link href="app.css" rel="stylesheet">
Perhaps with overrides for sheets in other languages like sass or less,
language= would help there, just as with
<link href="app.css" rel="stylesheet" unless-script-src>
Yes, you'd need two tags for the same content for a while. But that means that in a not-too-far-future we can actually use
<style> tags for external stylesheets, rather than
<link>s! The required closing tag would also count, just as with <script>.
unless-script-src attribute is a boolean attribute that serves as backwards compatibility flag to prevent double loading of the resource. Old browsers don't need to know about it and will ignore the empty <style> tag. New browsers will ignore the
<link> tag in favour of the
<style src="url">. Huzah! Of course,
unless-script-src can be bikeshed into anything. Even
It's not like
<link> isn't already burdened with many attributes anyways.
I could write a polyfill for this, but really?
Let's just make this happen, yes?