(no summary available)

[ This description is mirrored from README.md at github.com/daKmoR/grain-update-inline-style-behavior on 2019-05-10 ]

Published on webcomponents.org Polymer Version


In order for inline styles to work with Browsers not supporting CSS Custom Properties you will have to save your style into data-style as well. This behavior will extend updateStyles() to parse data-style and merge it with your styles.


<grain-update-inline-style-behavior-example style="--background: yellow;" data-style="--background: yellow;">
	I am an element with some inline style. <br />
	My Background will be yellow even on Browsers not supporting CSS Custom Properties. <br />
	For it to work data-style will need to be the same as style in the HTML.


$ bower install --save daKmoR/grain-update-inline-style-behavior

Getting Started

Import the package.

<link rel="import" href="/bower_components/grain-update-inline-style-behavior/grain-update-inline-style-behavior.html">

Create your element using this behavior.

class GrainUpdateInlineStyleBehaviorExample extends GrainUpdateInlineStyleBehavior(Polymer.Element) {
  // your code

Insert your element with style and data-style

<grain-update-inline-style-behavior-example style="--background: yellow;" data-style="--background: yellow;">
  Create Element with style AND data-style

For more information, see the API documentation.

Working on the Element

First, make sure you have the Polymer CLI installed.

  • View the Element via polymer serve
  • Run tests via polymer test


Link to this version
TestedReleased 25 May 2017Other
Framework Support
Polymer 1.0+
Browser Compatibility
Install with
Release notes - Version 0.8.1


Polymer/polymer#>=2.0.0-rc.2 <3.0