Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
astro-wt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b79bf0cb
authored
2025-01-15 16:22:47 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add a ::content pseudo-element.
1 parent
06a33897
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
lib/html.ts
lib/html.ts
View file @
b79bf0c
...
...
@@ -23,6 +23,7 @@ export const PSEUDO_ELEMENT = Symbol('PSEUDO_ELEMENT')
export
const
PSEUDO_ELEMENTS
=
{
after
:
{
type
:
PSEUDO_ELEMENT
,
name
:
'::after'
},
before
:
{
type
:
PSEUDO_ELEMENT
,
name
:
'::before'
},
content
:
{
type
:
PSEUDO_ELEMENT
,
name
:
'::content'
},
}
export
const
fixAttributes
=
(
attributes
,
options
=
{
mapClassname
:
true
})
=>
{
...
...
@@ -304,6 +305,8 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => {
return
(
context
,
node
,
parent
,
i
,
debug
,
special
)
=>
special
===
PSEUDO_ELEMENTS
.
after
case
'before'
:
return
(
context
,
node
,
parent
,
i
,
debug
,
special
)
=>
special
===
PSEUDO_ELEMENTS
.
before
case
'content'
:
return
(
context
,
node
,
parent
,
i
,
debug
,
special
)
=>
special
===
PSEUDO_ELEMENTS
.
content
default
:
console
.
error
(
'pseudo-class'
,
nodeUtil
.
inspect
({
selector
,
ast
},
{
depth
:
null
,
colors
:
true
}))
throw
new
Error
(
`Unknown pseudo-class:
${
ast
.
name
}
`
)
...
...
Please
register
or
sign in
to post a comment