update comments to reflect preference-based bucketing

This commit is contained in:
Karl Seguin
2026-03-19 10:22:19 +08:00
parent 94d8f90a96
commit b7bf86fd85

View File

@@ -478,11 +478,10 @@ const BucketKey = union(enum) {
other, other,
}; };
/// Returns the bucket key for a compound selector, or null if the selector /// Returns the best bucket key for a compound selector, or null if it contains
/// ends with a dynamic pseudo-class that we should skip (hover, active, focus, etc.) /// a dynamic pseudo-class we should skip (hover, active, focus, etc.)
/// Priority: id > class > tag > other
fn getBucketKey(compound: Selector.Compound) ?BucketKey { fn getBucketKey(compound: Selector.Compound) ?BucketKey {
// Iterate parts in reverse to find the most specific bucketing key
// Priority: id > class > tag > other
var best_key: BucketKey = .other; var best_key: BucketKey = .other;
for (compound.parts) |part| { for (compound.parts) |part| {