parcel-bundler / lightningcss

An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.
https://lightningcss.dev
Mozilla Public License 2.0
6.48k stars 188 forks source link

`box-sizing` is missing other value / enum #328

Open Stvchm9703 opened 2 years ago

Stvchm9703 commented 2 years ago

currently, I am writing a mini CSS property parser with lightning-css, and found out that some of the values cannot be exported properly.

// src/properties/size.rs  line:226
enum_property! {
  /// A value for the [box-sizing](https://drafts.csswg.org/css-sizing-3/#box-sizing) property.
  pub enum BoxSizing {
    /// Exclude the margin/border/padding from the width and height.
    "content-box": ContentBox,
    /// Include the padding and border (but not the margin) in the width and height.
    "border-box": BorderBox,
  }
}

by the MDN reference, box-sizing should include Global values (e.g. inherit, initial, revert, unset);

devongovett commented 2 years ago

At the moment this is true of all properties, because there's no need to duplicate the global keywords in every value type. When one of these is seen, it is parsed as a Property::Unparsed