Skip to content

Commit 125b0fa

Browse files
show how to use custom properties
1 parent 65d3ce9 commit 125b0fa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,25 @@ Web component to implement a ternary plot.
77
In an html file
88

99
```html
10+
<!DOCTYPE html>
1011
<html>
1112
<head>
1213
<script type="module">
1314
import 'https://unpkg.com/ternary-plot@latest/dist/ternary-plot.umd.js';
1415
</script>
1516
</head>
17+
<style>
18+
@import url('https://fonts.googleapis.com/css?family=Roboto+Mono:400,700&display=swap');
19+
/*
20+
CSS custom properties penetrate the Shadow DOM,
21+
they are useful to provide custom styling.
22+
The ternary-plot webcomponent exposes font-size and font-family custom properties.
23+
*/
24+
ternary-plot {
25+
--font-size: 13px;
26+
--font-family: 'Roboto Mono', monospace;
27+
}
28+
</style>
1629
<body>
1730
<ternary-plot side="400"></ternary-plot>
1831
</body>

0 commit comments

Comments
 (0)