Skip to content

Commit faf833e

Browse files
committed
feat: for :not
1 parent 843c89f commit faf833e

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/util/filterRules.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function filterRules($0: HTMLElement, objCss, taskTimerRecord) {
7575
.replace(REG1, ' * ')
7676
.replace(REG2, '(*)')
7777
.replace(REG3, '')
78+
.replace(/:not\(\*\)/ig, '')
7879

7980
try {
8081
if (

test/css/index.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ body {
9191
width: 20px;
9292
font-size:0;
9393
}
94+
.not-focus{
95+
width: 50px;
96+
height: 50px;
97+
border: 1px solid #000;
98+
}
99+
.not-focus:not(:focus){
100+
background: rgb(10, 149, 86);
101+
}
102+
.not-focus:focus{
103+
background: rgb(158, 51, 204);
104+
}
94105
@media print {
95106
i {
96107
font-size: 10pt;

test/index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<p class="S_spetxt">.S_spetxt</p>
4040
<div class="svg-bg">svg-bg</div>
4141
<div class="svg-bg-inpage">svg-bg-inpage</div>
42+
<button class="not-focus">focus</button>
4243
<iframe src="./iframe/index.html" frameborder="0"></iframe>
4344
<p>
4445
Compare text below with result in devtools, with &lt;html&gt; tag
@@ -72,7 +73,7 @@
7273
body{color:#333;text-decoration:none;}
7374
a{color:#76a513;}
7475
/*! end @import */
75-
:AFTER{content:'after';background:#38c;color:#fff;font-size:12px;opacity:0.1;}
76+
:AFTER{content:'after';background:#38c;color:#fff;font-size:12px;opacity:0;pointer-events:none;}
7677
html{height:100%;}
7778
A{background:url(${prefix}img/logo.jpg);background-size:100%;animation:teatnamekey;}
7879
@media screen and (min-width:500px){
@@ -85,6 +86,10 @@
8586
}
8687
body{font-family:"Cutive Mono";}
8788
.font-style{font-family:'Cutive Mono', icon-font, Inter, Avenir, Helvetica , Arial, sans-serif;}
89+
.svg-bg{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(0,0,0,.54)' d='M20.49 19l-5.73-5.73C15.53 12.2 16 10.91 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.41 0 2.7-.47 3.77-1.24L19 20.49 20.49 19zM5 9.5C5 7.01 7.01 5 9.5 5S14 7.01 14 9.5 11.99 14 9.5 14 5 11.99 5 9.5z'/%3E%3C/svg%3E");background-position:center;background-repeat:no-repeat;background-size:20px;height:20px;padding:10px;width:20px;font-size:0;}
90+
.not-focus{width:50px;height:50px;border:1px solid #000;}
91+
.not-focus:not(:focus){background:rgb(10, 149, 86);}
92+
.not-focus:focus{background:rgb(158, 51, 204);}
8893
@media print{
8994
i{font-size:10pt;}
9095
}
@@ -98,6 +103,8 @@
98103
@media print{
99104
i{color:#789;font-family:icon-font;}
100105
}
106+
/*! CSS Used from: Embedded */
107+
.svg-bg-inpage{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(0,0,0,.54)' d='M20.49 19l-5.73-5.73C15.53 12.2 16 10.91 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.41 0 2.7-.47 3.77-1.24L19 20.49 20.49 19zM5 9.5C5 7.01 7.01 5 9.5 5S14 7.01 14 9.5 11.99 14 9.5 14 5 11.99 5 9.5z'/%3E%3C/svg%3E");background-position:center;background-repeat:no-repeat;background-size:20px;height:20px;padding:10px;width:20px;font-size:0;}
101108
/*! CSS Used keyframes */
102109
@-webkit-keyframes teatnamekey{0%{width:10px;}100%{height:10px;}}
103110
@keyframes teatnamekey{0%{width:10px;}100%{height:10px;}}

0 commit comments

Comments
 (0)