Skip to content

Commit

Permalink
match css attribute selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrhmanSaid committed Mar 30, 2024
1 parent 371413a commit e4b4292
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Languages/Css/Patterns/CssSelectorPattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@
input: 'code, .asd, #id,
.hl-blur, @font-face,
kbd, samp,
pre {
pre,
[data-foo="bar"] {
font-family: ui-monospace, monospace;
}',
output: 'code, .asd, #id,
.hl-blur, @font-face,
kbd, samp,
pre ',
pre,
[data-foo="bar"] '
)]
final readonly class CssSelectorPattern implements Pattern
{
use IsPattern;

public function getPattern(): string
{
return '(?<match>[\@\-\#\.\w\s,\n]+)\{';
return '(?<match>[\@\-\#\.\w\s,\n\[\]+=\'"]+)\{';
}

public function getTokenType(): TokenTypeEnum
Expand Down

0 comments on commit e4b4292

Please sign in to comment.