Closed warpech closed 8 years ago
To apply a stylesheet to the shadow DOM, it must be brought in with rel="import"
within the template. Unfortunately, polymer's transformations do not appear to work for non-shadow DOM, so in order to work with both modes I've found it necessary to bring in the stylesheet twice, once using the normal rel="stylesheet"
for "shady" DOM and again with the rel="import"
for shadow.
The suggested way is to use Polymer's Shared Styles: https://www.polymer-project.org/1.0/docs/devguide/styling.html#style-modules
I have pushed a fix to fix-styles-issue-23
branch. You can see both ways working:
index.html
index-shadow-dom.html
Note: that styles need to be added to your regular <head>
as <style is="custom-style" include="hot-table-style"></style>
, because Handsontable's dynamic DOM tree is not shimmed correctly in Shady DOM.
Note 2: the file src/hot-table-style.html
is a copy-paste of handsontable.full.css
. It should be created by a script (Gulpfile, etc)
@budnix could you please review and merge if you agree?
Bump. This is important for us. I have opened a PR for this: https://github.com/handsontable/hot-table/pull/30
@budnix could you please review and merge if you agree?
@warpech I've reviewed, merged into develop and released as v0.5.0. Thanks!
Nice, thank you!
In future please make sure that src/hot-table-style.html
is updated whenever handsontable.full.css
changes.
hot-table styles don't appear at all if Polymer 1.1 is loaded in Shadow DOM enabled mode.
Screenshot:
Polymer has some info about it: https://www.polymer-project.org/1.0/docs/devguide/settings.html https://www.polymer-project.org/1.0/docs/devguide/styling.html