window.ShadyCSS
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 发布文章使用:只允许注册用户才可以访问!
最新文章
- Wpf 中的DataGrid的Header属性,动态bind时不起作用
- bootstrap 模态 modal 小例子
- 通过XmlHttpRequest实现带进度条异步下载文件
- form表单及其中元素
- ORA-12154 &; TNS-03505 案例分享
- 图解SVD分解
- Awake和Start
- [Android]Eclipse的使用
- [SDOI2010]粟粟的书架
- Hadoop系列009-NameNode工作机制
- js 比大小
- 如何成功再次安装MYSQL
- php -- 显示当前时间
- eclipse,myeclipse综合
- HDU6029 Happy Necklace 2017-05-07 19:11 45人阅读 评论(0) 收藏
- MySQL案例03:(MyCAT报错) [ERROR][$_NIOREACTOR-3-RW] caught err: java.lang.OutOfM emoryError: Unable to acquire 131072 bytes of memory, got 0
- this指针逃逸问题
- Java虚拟机的平台无关性与语言无关性
- mapreduce-实现多表关联
- javascript 在js文件中获取路径
热门文章
- 正向代理 forward proxy、反向代理 reverse proxy、透明代理 transparent proxy
- (009)每日SQL学习:Oracle各个键说明(转)
- kettle 连接oracle12c问题解决办法:
- 获取当前文件路径 import 原理 一般把模块组成的集合称为包(package)
- 【LinuxShell】命令行常用快捷键
- Trie(字典树)
- 关于ckfinder上传文件添加自定义处理方案
- Docker安装Mycat并实现mysql读写分离,分库分表
- Linux常用命令详解(第二章)(cat、more、less、head、tail、clear、poweroff、reboot、alias、unalias、uname、hostname、history、whitch、wc、w、who、whoami、)
- Java中详述线程间协作