Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions pkgs/csslib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 1.0.3-wip

- Recognize the `rebeccapurple` color keyword.
- Correctly parse unit-like type selectors (`rem`, `vw`, `dpi`, etc.) at the
start of `selector()` and `parseSelectorGroup()` input and of style rules.
- Fix `@namespace` serialization: quote bare URIs in pretty output and stop
Expand Down
1 change: 1 addition & 0 deletions pkgs/csslib/lib/src/token_kind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ class TokenKind {
{'name': 'plum', 'value': 0xDDA0DD},
{'name': 'powderblue', 'value': 0xB0E0E6},
{'name': 'purple', 'value': 0x800080},
{'name': 'rebeccapurple', 'value': 0x663399},
Comment thread
palmoni5 marked this conversation as resolved.
Resolved
{'name': 'red', 'value': 0xFF0000},
{'name': 'rosybrown', 'value': 0xBC8F8F},
{'name': 'royalblue', 'value': 0x4169E1},
Expand Down
15 changes: 15 additions & 0 deletions pkgs/csslib/test/color_keyword_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:csslib/parser.dart';
import 'package:test/test.dart';

void main() {
test('rebeccapurple is a named color', () {
expect(TokenKind.colorValue(TokenKind.matchColorName('rebeccapurple')!),
0x663399);
expect(TokenKind.colorValue(TokenKind.matchColorName('RebeccaPurple')!),
0x663399);
});
}
Loading