forked from Polymer/polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcss-gradient-var.html
48 lines (48 loc) · 1.33 KB
/
css-gradient-var.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Gradient in variable</title>
<!-- <script>Polymer={useNativeCSSProperties: true, lazyRegister: true}</script> -->
<link rel="import" href="../../polymer.html">
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
</head>
<body>
<style is="custom-style">
:root {
--a: 10px;
--b: 20px;
--default1: 10px;
}
</style>
<dom-module id="var-el">
<template>
<style>
:host {
--color1: 123;
--color2: 321;
--color3: 231;
display: block;
height: 100px;
width: 100px;
color: var(--undefined, rgb(var(--color1), var(--color2), var(--color3)));
background: var(--fx-webkit-background, -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,0,0,.65)), color-stop(100%,rgba(0,0,255,.65))));
border-width: calc(var(--a) + var(--b));
border-color: brown;
border-style: solid;
padding-bottom: var(--undefined, --default1);
}
</style>
<div>Hi!</div>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'var-el'
})
});
</script>
</dom-module>
<var-el></var-el>
</body>
</html>