-
Notifications
You must be signed in to change notification settings - Fork 170
Semantic way for loading styles #69
Comments
The reason it doesn't work is because senna data attributes handler uses You can register them via JavaScript: var app = senna.dataAttributeHandler.getApp();
app.addSurfaces('style'); This should work. |
I tried to do as you suggested, setting an I started debugging the code and realized when I click the link it is appending a |
Well, that make sense, it appends the screen history to it. It's not possible then to do that currently. In order to support it needs to support customizing the content element from div to something else, or even nothing. The closest you can get for now is: Place the style inside a <div id="style">
<div id="style-default">
<style>body{background: blue;}</style>
</div>
</div> We usually do that on the |
Yes, I am currently using it in the body here. I digged a little deeper though, and it seems that according to here if the scoped attribute is present, the style tag becomes a flow content:
In this case it may be reasonable to put the style content inside the body with the |
SGTM. Let me know how that goes and if the outcome is fine feel free to close the issue. Thank you for reporting. |
The spec does not allow
<style>
tags inside other element than the<head>
element.The following elements can be used inside a
<head>
:<title>
,<base>
,<link>
,<style>
,<meta>
,<script>
,<noscript>
,<command>
.I can't declare
style
tags as a surface using data attributes and still keeping my document spec compliant, because I can't addid="style"
andid="style-default"
elements into the document'shead
.What is the recommended practice for loading styles using senna?
The text was updated successfully, but these errors were encountered: