-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed css escape chars #4104
base: main
Are you sure you want to change the base?
fixed css escape chars #4104
Changes from 3 commits
f5ff559
64d0527
8cf4030
6ff1f64
fb7b880
b531a56
431ada2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ export default function(hljs) { | |
const VENDOR_PREFIX = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }; | ||
const AT_MODIFIERS = "and or not only"; | ||
const AT_PROPERTY_RE = /@-?\w[\w]*(-\w+)*/; // @-webkit-keyframes | ||
const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*'; | ||
const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*(\\\\:[a-zA-Z0-9_-]+)*'; | ||
const STRINGS = [ | ||
hljs.APOS_STRING_MODE, | ||
hljs.QUOTE_STRING_MODE | ||
|
@@ -37,7 +37,7 @@ export default function(hljs) { | |
modes.CSS_NUMBER_MODE, | ||
{ | ||
className: 'selector-id', | ||
begin: /#[A-Za-z0-9_-]+/, | ||
begin: '#' + IDENT_RE, | ||
relevance: 0 | ||
}, | ||
{ | ||
|
@@ -49,8 +49,8 @@ export default function(hljs) { | |
{ | ||
className: 'selector-pseudo', | ||
variants: [ | ||
{ begin: ':(' + css.PSEUDO_CLASSES.join('|') + ')' }, | ||
{ begin: ':(:)?(' + css.PSEUDO_ELEMENTS.join('|') + ')' } | ||
{ begin: '(?<!\\\\):(' + css.PSEUDO_CLASSES.join('|') + ')'}, | ||
{ begin: '(?<!\\\\):(:)?(' + css.PSEUDO_ELEMENTS.join('|') + ')'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These (look-behind) are problematic until we hit v12 - as this would be a breaking change to introduce to v11 since it would change which browsers v11 supports (Safari was very late to this party). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed it in the new pr |
||
] | ||
}, | ||
// we may actually need this (12/2020) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,47 @@ p::first-letter { | |
font-weight: bold; | ||
color: brown; | ||
} | ||
.dark\:hover\:bg-sky-500:hover { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two or three (tops) of these longer examples should be sufficient unless there is some big difference here I'm missing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay ill reduce the newer tc |
||
--tw-bg-opacity: 1; | ||
background-color: rgb(14 165 233 / var(--tw-bg-opacity)); | ||
} | ||
|
||
.dark\:hover\:bg-sky-600\:text-white:hover { | ||
--tw-bg-opacity: 1; | ||
background-color: rgb(2 132 199 / var(--tw-bg-opacity)); | ||
color: white; | ||
} | ||
|
||
.dark\:hover\:bg-sky-700\:text-white\:border:hover { | ||
--tw-bg-opacity: 1; | ||
background-color: rgb(3 105 161 / var(--tw-bg-opacity)); | ||
color: white; | ||
border: 1px solid white; | ||
} | ||
|
||
.dark\:hover\:bg-sky-800\:text-white\:border\:rounded:hover { | ||
--tw-bg-opacity: 1; | ||
background-color: rgb(7 89 133 / var(--tw-bg-opacity)); | ||
color: white; | ||
border: 1px solid white; | ||
border-radius: 0.5rem; | ||
} | ||
|
||
.dark\:hover\:bg-sky-900\:text-white\:border\:rounded\:shadow:hover { | ||
--tw-bg-opacity: 1; | ||
background-color: rgb(12 74 110 / var(--tw-bg-opacity)); | ||
color: white; | ||
border: 1px solid white; | ||
border-radius: 0.5rem; | ||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); | ||
} | ||
|
||
.dark\:hover\:bg-sky-950\:text-white\:border\:rounded\:shadow\:p-4:hover { | ||
--tw-bg-opacity: 1; | ||
background-color: rgb(2 32 56 / var(--tw-bg-opacity)); | ||
color: white; | ||
border: 1px solid white; | ||
border-radius: 0.5rem; | ||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); | ||
padding: 1rem; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
::
escaping supported? Or escaping any other chars? Feels like this is just handling this one edge case vs the concept of escaping in general - are there other uses?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ive managed to generalize to include other special chars in the new commit pls review