Skip to content

Commit 8be4011

Browse files
authored
[FEATURE] Parse container queries (#1400)
1 parent 9614279 commit 8be4011

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Please also have a look at our
1010

1111
### Added
1212

13+
- Support for CSS container queries (#1400)
14+
1315
### Changed
1416

1517
### Deprecated

src/Property/AtRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface AtRule extends CSSListItem
1818
*
1919
* @internal since 8.5.2
2020
*/
21-
public const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values';
21+
public const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values/container';
2222

2323
/**
2424
* @return non-empty-string

tests/CSSList/AtRuleBlockListTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public static function provideSyntacticallyCorrectAtRule(): array
4848
}
4949
',
5050
],
51+
'container' => [
52+
'@container (min-width: 60rem) { .items { background: blue; } }',
53+
],
5154
];
5255
}
5356

tests/Unit/Property/AtRuleTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Sabberworm\CSS\Tests\Unit\Property;
6+
7+
use PHPUnit\Framework\TestCase;
8+
use Sabberworm\CSS\Property\AtRule;
9+
10+
final class AtRuleTest extends TestCase
11+
{
12+
/**
13+
* @test
14+
*/
15+
public function blockRulesConstantIsCorrect(): void
16+
{
17+
self::assertEqualsCanonicalizing(
18+
['media', 'document', 'supports', 'region-style', 'font-feature-values', 'container'],
19+
explode('/', AtRule::BLOCK_RULES)
20+
);
21+
}
22+
}

0 commit comments

Comments
 (0)