Skip to content

Commit

Permalink
Fix user-select: contain
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jan 17, 2024
1 parent 1db31f0 commit b0a4007
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions lib/hacks/user-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class UserSelect extends Declaration {
insert(decl, prefix, prefixes) {
if (decl.value === 'all' && prefix === '-ms-') {
return undefined
} else if (
decl.value === 'contain' &&
(prefix === '-moz-' || prefix === '-webkit-')
) {
return undefined
} else {
return super.insert(decl, prefix, prefixes)
}
Expand Down
5 changes: 2 additions & 3 deletions test/cases/user-select.out.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ a {
}

b {
-webkit-user-select: contain;
-ms-user-select: element;
user-select: contain;
-ms-user-select: element;
user-select: contain;
}

.all {
Expand Down

0 comments on commit b0a4007

Please sign in to comment.