grain-update-inline-style-behavior

WebJar for grain-update-inline-style-behavior

License

License

MIT
GroupId

GroupId

org.webjars.bowergithub.dakmor
ArtifactId

ArtifactId

grain-update-inline-style-behavior
Last Version

Last Version

0.8.1
Release Date

Release Date

Type

Type

jar
Description

Description

grain-update-inline-style-behavior
WebJar for grain-update-inline-style-behavior
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/daKmoR/grain-update-inline-style-behavior

Download grain-update-inline-style-behavior

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.dakmor/grain-update-inline-style-behavior/ -->
<dependency>
    <groupId>org.webjars.bowergithub.dakmor</groupId>
    <artifactId>grain-update-inline-style-behavior</artifactId>
    <version>0.8.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.dakmor/grain-update-inline-style-behavior/
implementation 'org.webjars.bowergithub.dakmor:grain-update-inline-style-behavior:0.8.1'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.dakmor/grain-update-inline-style-behavior/
implementation ("org.webjars.bowergithub.dakmor:grain-update-inline-style-behavior:0.8.1")
'org.webjars.bowergithub.dakmor:grain-update-inline-style-behavior:jar:0.8.1'
<dependency org="org.webjars.bowergithub.dakmor" name="grain-update-inline-style-behavior" rev="0.8.1">
  <artifact name="grain-update-inline-style-behavior" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.dakmor', module='grain-update-inline-style-behavior', version='0.8.1')
)
libraryDependencies += "org.webjars.bowergithub.dakmor" % "grain-update-inline-style-behavior" % "0.8.1"
[org.webjars.bowergithub.dakmor/grain-update-inline-style-behavior "0.8.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bowergithub.polymer : polymer jar [2.0.0-rc.2,3.0)

Project Modules

There are no modules declared in this project.

Published on webcomponents.org Polymer Version

<grain-update-inline-style-behavior>

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.

Demo

<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.
</grain-update-inline-style-behavior-example>

Installation

$ 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
</grain-update-inline-style-behavior-example>

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

Versions

Version
0.8.1