Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Don’t move ::ng-deep pseudo element
  • Loading branch information
thecrypticace committed Apr 4, 2023
commit da1f18135260df479ebb2d3377e448ac67c218ce
3 changes: 3 additions & 0 deletions src/util/formatVariantSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ let pseudoElementExceptions = [
'::-webkit-scrollbar-track-piece',
'::-webkit-scrollbar-corner',
'::-webkit-resizer',

// Old-style Angular Shadow DOM piercing pseudo element
'::ng-deep',
]

/**
Expand Down
30 changes: 30 additions & 0 deletions tests/apply.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2427,4 +2427,34 @@ crosscheck(({ stable, oxide }) => {
`)
})
})

stable.test('::ng-deep pseudo element is left alone', () => {
let config = {
darkMode: 'class',
content: [
{
raw: html` <div class="foo bar"></div> `,
},
],
}

let input = css`
::ng-deep .foo .bar {
@apply font-bold;
}
`

return run(input, config).then((result) => {
expect(result.css).toMatchFormattedCss(css`
::ng-deep .foo .bar {
font-weight: 700;
}
`)
})
})

// 1. `::ng-deep` is deprecated
// 2. It uses invalid selector syntax that Lightning CSS does not support
// It may be enough for Oxide to not support it at all
oxide.test.todo('::ng-deep pseudo element is left alone')
})