Skip to content

Commit

Permalink
refactor(design-tokens): replace body with root (#1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
yinonov committed Nov 5, 2021
1 parent 5fb7e85 commit 1530872
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 18 deletions.
15 changes: 0 additions & 15 deletions common/scheme/src/partials/_scheme-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@ $scheme-main: vvd-scheme-main;
$scheme-alternate: vvd-scheme-alternate;


@mixin scheme-context-variables {
body,
.#{$scheme-main},
::part(#{$scheme-main}) {
@content;
}
}

@mixin scheme-alternate-variables {
.#{$scheme-alternate},
::part(#{$scheme-alternate}) {
@content;
}
}

@mixin color-scheme($type) {
@supports (color-scheme: $type) {
color-scheme: $type;
Expand Down
2 changes: 1 addition & 1 deletion common/scheme/src/partials/_scheme-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ $scheme-main: vvd-scheme-main;
$scheme-alternate: vvd-scheme-alternate;


$scheme-main-selector: 'body, .#{$scheme-main}, ::part(#{$scheme-main})';
$scheme-main-selector: ':root, .#{$scheme-main}, ::part(#{$scheme-main})';
$scheme-alternate-selector: '.#{$scheme-alternate}, ::part(#{$scheme-alternate})';
45 changes: 45 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script type="module">
import 'api-viewer-element';
import '@vonage/vwc-button';
</script>
<style>
api-viewer::part(select) {
display: none;
}
</style>
</head>

<body>
<api-viewer src="./custom-elements.json" section="demo" selected="vwc-button">
<template data-element="vwc-button" data-target="knob" data-attr="dir" data-type="source">
<select>
<option value=""></option>
<option value="ltr"></option>
<option value="rtl"></option>
</select>
</template>
<template data-element="vwc-button" data-target="knob" data-attr="dir" data-type="select">
<select>
<option value=""></option>
<option value="ltr"></option>
<option value="rtl"></option>
</select>
</template>
<template data-element="vwc-button" data-target="host">
<vwc-button>
Button
</vwc-button>
</template>
</api-viewer>

</body>

</html>
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"@typescript-eslint/parser": "^5.1.0",
"@vonage/monowatch": "^0.0.7",
"@whitespace/storybook-addon-html": "^5.0.0",
"api-viewer-element": "^0.5.0",
"chai": "^4.3.4",
"chai-a11y-axe": "^1.3.1",
"chai-dom": "^1.10.0",
Expand Down Expand Up @@ -154,4 +155,4 @@
"disableUsageStatistics": true
},
"_void_cache": true
}
}
77 changes: 76 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2275,6 +2275,11 @@
npmlog "^4.1.2"
write-file-atomic "^3.0.3"

"@lit/reactive-element@^1.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.0.1.tgz#853cacd4d78d79059f33f66f8e7b0e5c34bee294"
integrity sha512-nSD5AA2AZkKuXuvGs8IK7K5ZczLAogfDd26zT9l6S7WzvqALdVWcW5vMUiTnZyj5SPcNwNNANj0koeV1ieqTFQ==

"@material/animation@12.0.0-canary.22d29cbb4.0":
version "12.0.0-canary.22d29cbb4.0"
resolved "https://registry.yarnpkg.com/@material/animation/-/animation-12.0.0-canary.22d29cbb4.0.tgz#662314409f968aa14156a87284d1f49a098880be"
Expand Down Expand Up @@ -4600,6 +4605,13 @@
resolved "https://registry.yarnpkg.com/@types/debounce/-/debounce-1.2.0.tgz#9ee99259f41018c640b3929e1bb32c3dcecdb192"
integrity sha512-bWG5wapaWgbss9E238T0R6bfo5Fh3OkeoSt245CM7JJwVwpw6MEBCbIxLq5z8KzsE3uJhzcIuQkyiZmzV3M/Dw==

"@types/dompurify@^2.3.1":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-2.3.1.tgz#2934adcd31c4e6b02676f9c22f9756e5091c04dd"
integrity sha512-YJth9qa0V/E6/XPH1Jq4BC8uCMmO8V1fKWn8PCvuZcAhMn7q0ez9LW6naQT04UZzjFfAPhyRMZmI2a2rbMlEFA==
dependencies:
"@types/trusted-types" "*"

"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
Expand Down Expand Up @@ -5037,6 +5049,11 @@
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310"
integrity sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ==

"@types/trusted-types@*", "@types/trusted-types@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==

"@types/uglify-js@*":
version "3.13.1"
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.13.1.tgz#5e889e9e81e94245c75b6450600e1c5ea2878aea"
Expand Down Expand Up @@ -5818,6 +5835,18 @@ anymatch@^3.0.0, anymatch@^3.0.3, anymatch@~3.1.1, anymatch@~3.1.2:
normalize-path "^3.0.0"
picomatch "^2.0.4"

api-viewer-element@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/api-viewer-element/-/api-viewer-element-0.5.0.tgz#f5468ab22389f487b40eeb214886783efc685449"
integrity sha512-35pKedqlix423SnKzQE6FGHIxKAxBsmfVTOU1HpCbUpKm5sYZgPMudYM5W/GC3E3f5PcICUkqMpq/P+XlbesNQ==
dependencies:
"@types/dompurify" "^2.3.1"
dompurify "^2.3.3"
highlight-ts "9.12.1-2"
lit "^2.0.0"
marked "^3.0.0"
tslib "^2.3.1"

app-root-dir@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/app-root-dir/-/app-root-dir-1.0.2.tgz#38187ec2dea7577fff033ffcb12172692ff6e118"
Expand Down Expand Up @@ -8693,6 +8722,11 @@ domhandler@^4.0.0, domhandler@^4.2.0:
dependencies:
domelementtype "^2.2.0"

dompurify@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.3.tgz#c1af3eb88be47324432964d8abc75cf4b98d634c"
integrity sha512-dqnqRkPMAjOZE0FogZ+ceJNM2dZ3V/yNOuFB7+39qpO93hHhfRpHw3heYQC7DPK9FqbQTfBKUJhiSfz4MvXYwg==

domutils@^1.5.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
Expand Down Expand Up @@ -10967,6 +11001,13 @@ header-case@^2.0.4:
capital-case "^1.0.4"
tslib "^2.0.3"

highlight-ts@9.12.1-2:
version "9.12.1-2"
resolved "https://registry.yarnpkg.com/highlight-ts/-/highlight-ts-9.12.1-2.tgz#792e79b3f8e1e7c9f017cf1cc52fc4cfe694fbee"
integrity sha512-CkLnKaxdwUasdPbzM9YP3EQTYfY/jgLQ4dyl7FFa65h1Ymq/qm+FOsevfNRqI7ZKGlz9scPkAy9OXYvwEtcJSw==
dependencies:
tslib "^1"

highlight.js@^10.1.1, highlight.js@^10.4.0, highlight.js@^10.4.1, highlight.js@~10.7.0:
version "10.7.3"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531"
Expand Down Expand Up @@ -12839,6 +12880,14 @@ lit-element@^2.0.0, lit-element@^2.2.1, lit-element@^2.3.0, lit-element@^2.4.0,
dependencies:
lit-html "^1.1.1"

lit-element@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.0.1.tgz#3c545af17d8a46268bc1dd5623a47486e6ff76f4"
integrity sha512-vs9uybH9ORyK49CFjoNGN85HM9h5bmisU4TQ63phe/+GYlwvY/3SIFYKdjV6xNvzz8v2MnVC+9+QOkPqh+Q3Ew==
dependencies:
"@lit/reactive-element" "^1.0.0"
lit-html "^2.0.0"

lit-element@~2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-2.4.0.tgz#b22607a037a8fc08f5a80736dddf7f3f5d401452"
Expand All @@ -12861,6 +12910,22 @@ lit-html@^1.0.0, lit-html@^1.1.1, lit-html@^1.1.2, lit-html@^1.3.0, lit-html@^1.
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.4.1.tgz#0c6f3ee4ad4eb610a49831787f0478ad8e9ae5e0"
integrity sha512-B9btcSgPYb1q4oSOb/PrOT6Z/H+r6xuNzfH4lFli/AWhYwdtrgQkQWBbIc6mdnf6E2IL3gDXdkkqNktpU0OZQA==

lit-html@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.1.tgz#63241015efa07bc9259b6f96f04abd052d2a1f95"
integrity sha512-KF5znvFdXbxTYM/GjpdOOnMsjgRcFGusTnB54ixnCTya5zUR0XqrDRj29ybuLS+jLXv1jji6Y8+g4W7WP8uL4w==
dependencies:
"@types/trusted-types" "^2.0.2"

lit@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/lit/-/lit-2.0.2.tgz#5e6f422924e0732258629fb379556b6d23f7179c"
integrity sha512-hKA/1YaSB+P+DvKWuR2q1Xzy/iayhNrJ3aveD0OQ9CKn6wUjsdnF/7LavDOJsKP/K5jzW/kXsuduPgRvTFrFJw==
dependencies:
"@lit/reactive-element" "^1.0.0"
lit-element "^3.0.0"
lit-html "^2.0.0"

load-bmfont@^1.3.1, load-bmfont@^1.4.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/load-bmfont/-/load-bmfont-1.4.1.tgz#c0f5f4711a1e2ccff725a7b6078087ccfcddd3e9"
Expand Down Expand Up @@ -13265,6 +13330,11 @@ markdown-to-jsx@^7.1.3:
resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.1.3.tgz#f00bae66c0abe7dd2d274123f84cb6bd2a2c7c6a"
integrity sha512-jtQ6VyT7rMT5tPV0g2EJakEnXLiPksnvlYtwQsVVZ611JsWGN8bQ1tVSDX4s6JllfEH6wmsYxNjTUAMrPmNA8w==

marked@^3.0.0:
version "3.0.8"
resolved "https://registry.yarnpkg.com/marked/-/marked-3.0.8.tgz#2785f0dc79cbdc6034be4bb4f0f0a396bd3f8aeb"
integrity sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==

mathml-tag-names@^2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3"
Expand Down Expand Up @@ -18426,7 +18496,7 @@ tsconfig-paths@^3.11.0:
minimist "^1.2.0"
strip-bom "^3.0.0"

tslib@^1.11.0, tslib@^1.11.1, tslib@^1.7.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
tslib@^1, tslib@^1.11.0, tslib@^1.11.1, tslib@^1.7.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
Expand All @@ -18436,6 +18506,11 @@ tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==

tslib@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==

tsscmp@1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
Expand Down

0 comments on commit 1530872

Please sign in to comment.