Many people may be familiar with the introduction of scoped in the HTML5 specification:
<style scoped="scoped">
This allows for locally scoped style elements to exist outside the <head>
section of a page.
Instead of inline styles, we would prefer to reference local styles from external CSS files, and we were exploring the following approach:
<link href="somelocalstylefile.css" rel="stylesheet" type="text/css" scoped="scoped">
Unfortunately, the ability to localize styles using <link>
is not included in the HTML5 spec.
Is there another way that is compliant with HTML5 to apply styles locally from an external CSS file?