window.ShadyCSS

Web Components

# install
$ yarn add @webcomponents/shadycss@1.7.1 # OR
$ npm i @webcomponents/shadycss@1.7.1

$ npm i @webcomponents/shadycss

ShadyCSS provides a library to simulate ShadowDOM style encapsulation (ScopingShim),

a shim for the proposed CSS mixin @apply syntax (ApplyShim),

and a library to integrate document-level stylesheets with both of the former libraries (CustomStyleInterface).

https://github.com/webcomponents/shadycss

https://www.npmjs.com/package/@webcomponents/shadycss

demo

/* istanbul ignore next */
if (window.ShadyCSS) window.ShadyCSS.prepareTemplate(template, tagName);

::slotted

::slotted

/* Selects any element placed inside a slot */

::slotted(*) {
font-weight: bold;
} /* Selects any <span> placed inside a slot */
::slotted(span) {
font-weight: bold;
}

https://developer.mozilla.org/en-US/docs/Web/CSS/::slotted

https://developers.google.com/web/fundamentals/web-components/shadowdom

https://javascript.info/shadow-dom-style

https://github.com/w3c/webcomponents/issues/655

https://stackoverflow.com/questions/49678342/css-how-to-target-slotted-siblings-in-shadow-dom-root

https://patternfly.github.io/patternfly-elements/develop/templates/

:host

:host


/* Selects a shadow root host */
:host {
font-weight: bold;
}

https://developer.mozilla.org/en-US/docs/Web/CSS/:host

https://developers.google.com/web/fundamentals/web-components/shadowdom

:root

:root


@charset "UTf-8"; /* c3t.css */ :root {
--color: #000;
--default-color: green;
--new-color: #0f0;
} html{
/* font-size: 62.5%; */
/* 10px = 1rem */
} * {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
margin: 0;
padding: 0;
} html, body, div, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, object, code, legend, button, input, textarea, th, td, a, img, video {
margin: 0;
padding: 0;
border: 0;
outline: 0;
}

refs

https://github.com/webcomponents/shadycss

https://www.npmjs.com/package/@webcomponents/shadycss/v/1.7.1

https://www.cnblogs.com/xgqfrms/p/13258493.html



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


最新文章

  1. Wpf 中的DataGrid的Header属性,动态bind时不起作用
  2. bootstrap 模态 modal 小例子
  3. 通过XmlHttpRequest实现带进度条异步下载文件
  4. form表单及其中元素
  5. ORA-12154 &amp; TNS-03505 案例分享
  6. 图解SVD分解
  7. Awake和Start
  8. [Android]Eclipse的使用
  9. [SDOI2010]粟粟的书架
  10. Hadoop系列009-NameNode工作机制
  11. js 比大小
  12. 如何成功再次安装MYSQL
  13. php -- 显示当前时间
  14. eclipse,myeclipse综合
  15. HDU6029 Happy Necklace 2017-05-07 19:11 45人阅读 评论(0) 收藏
  16. MySQL案例03:(MyCAT报错) [ERROR][$_NIOREACTOR-3-RW] caught err: java.lang.OutOfM emoryError: Unable to acquire 131072 bytes of memory, got 0
  17. this指针逃逸问题
  18. Java虚拟机的平台无关性与语言无关性
  19. mapreduce-实现多表关联
  20. javascript 在js文件中获取路径

热门文章

  1. 正向代理 forward proxy、反向代理 reverse proxy、透明代理 transparent proxy
  2. (009)每日SQL学习:Oracle各个键说明(转)
  3. kettle 连接oracle12c问题解决办法:
  4. 获取当前文件路径 import 原理 一般把模块组成的集合称为包(package)
  5. 【LinuxShell】命令行常用快捷键
  6. Trie(字典树)
  7. 关于ckfinder上传文件添加自定义处理方案
  8. Docker安装Mycat并实现mysql读写分离,分库分表
  9. Linux常用命令详解(第二章)(cat、more、less、head、tail、clear、poweroff、reboot、alias、unalias、uname、hostname、history、whitch、wc、w、who、whoami、)
  10. Java中详述线程间协作