fix(css/ast): Use correct type for units (#2464)

This commit is contained in:
Alexander Akait 2021-10-19 11:32:59 +03:00 committed by GitHub
parent 123c1f5d02
commit 5234530cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 301 additions and 200 deletions

22
Cargo.lock generated
View File

@ -2364,9 +2364,7 @@ dependencies = [
[[package]]
name = "swc_atoms"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a20e0ff436c9967b5cbafbc0872f384fef5be6f9913ce92fb5f017427e95c7e"
version = "0.2.9"
dependencies = [
"string_cache",
"string_cache_codegen",
@ -2375,6 +2373,8 @@ dependencies = [
[[package]]
name = "swc_atoms"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f5229fe227ff0060e13baa386d6e368797700eab909523f730008d191ee53ae"
dependencies = [
"string_cache",
"string_cache_codegen",
@ -2501,7 +2501,7 @@ dependencies = [
[[package]]
name = "swc_css"
version = "0.20.0"
version = "0.21.0"
dependencies = [
"swc_css_ast",
"swc_css_codegen",
@ -2512,7 +2512,7 @@ dependencies = [
[[package]]
name = "swc_css_ast"
version = "0.18.1"
version = "0.19.0"
dependencies = [
"is-macro",
"serde",
@ -2523,7 +2523,7 @@ dependencies = [
[[package]]
name = "swc_css_codegen"
version = "0.18.0"
version = "0.19.0"
dependencies = [
"auto_impl",
"bitflags",
@ -2549,7 +2549,7 @@ dependencies = [
[[package]]
name = "swc_css_parser"
version = "0.20.0"
version = "0.21.0"
dependencies = [
"bitflags",
"lexical",
@ -2565,7 +2565,7 @@ dependencies = [
[[package]]
name = "swc_css_utils"
version = "0.15.0"
version = "0.16.0"
dependencies = [
"swc_atoms 0.2.9",
"swc_common",
@ -2575,7 +2575,7 @@ dependencies = [
[[package]]
name = "swc_css_visit"
version = "0.17.0"
version = "0.18.0"
dependencies = [
"swc_atoms 0.2.9",
"swc_common",
@ -3121,7 +3121,7 @@ dependencies = [
"libloading",
"serde",
"serde_json",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -3146,7 +3146,7 @@ dependencies = [
[[package]]
name = "swc_stylis"
version = "0.17.0"
version = "0.18.0"
dependencies = [
"swc_atoms 0.2.9",
"swc_common",

View File

@ -6,11 +6,11 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css"
repository = "https://github.com/swc-project/swc.git"
version = "0.20.0"
version = "0.21.0"
[dependencies]
swc_css_ast = {version = "0.18.0", path = "./ast"}
swc_css_codegen = {version = "0.18.0", path = "./codegen"}
swc_css_parser = {version = "0.20.0", path = "./parser"}
swc_css_utils = {version = "0.15.0", path = "./utils/"}
swc_css_visit = {version = "0.17.0", path = "./visit"}
swc_css_ast = {version = "0.19.0", path = "./ast"}
swc_css_codegen = {version = "0.19.0", path = "./codegen"}
swc_css_parser = {version = "0.21.0", path = "./parser"}
swc_css_utils = {version = "0.16.0", path = "./utils/"}
swc_css_visit = {version = "0.18.0", path = "./visit"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_ast"
repository = "https://github.com/swc-project/swc.git"
version = "0.18.1"
version = "0.19.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,7 +1,5 @@
//! AST definitions for CSS.
pub use self::{
at_rule::*, base::*, property::*, selector::*, style_rule::*, token::*, unit::*, value::*,
};
pub use self::{at_rule::*, base::*, property::*, selector::*, style_rule::*, token::*, value::*};
use is_macro::Is;
use swc_common::{ast_node, Span};
@ -11,7 +9,6 @@ mod property;
mod selector;
mod style_rule;
mod token;
mod unit;
mod value;
#[ast_node("Stylesheet")]

View File

@ -1,26 +0,0 @@
use serde::{Deserialize, Serialize};
use swc_atoms::JsWord;
use swc_common::{ast_node, Span};
#[ast_node]
pub struct Unit {
pub span: Span,
pub kind: UnitKind,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UnitKind {
#[serde(rename = "px")]
Px,
Custom(JsWord),
}
impl From<JsWord> for UnitKind {
fn from(s: JsWord) -> Self {
match &*s.to_ascii_lowercase() {
"px" => UnitKind::Px,
_ => UnitKind::Custom(s),
}
}
}

View File

@ -1,4 +1,4 @@
use crate::{Num, Str, Text, Tokens, Unit};
use crate::{Num, Str, Text, Tokens};
use string_enum::StringEnum;
use swc_atoms::JsWord;
use swc_common::{ast_node, EqIgnoreSpan, Span};
@ -116,6 +116,13 @@ pub struct HashValue {
pub value: JsWord,
}
#[ast_node]
pub struct Unit {
pub span: Span,
pub value: JsWord,
pub raw: JsWord,
}
#[ast_node("UnitValue")]
pub struct UnitValue {
pub span: Span,

View File

@ -6,17 +6,17 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_codegen"
repository = "https://github.com/swc-project/swc.git"
version = "0.18.0"
version = "0.19.0"
[dependencies]
auto_impl = "0.4.1"
bitflags = "1.3.2"
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_css_ast = {version = "0.18.0", path = "../ast/"}
swc_css_ast = {version = "0.19.0", path = "../ast/"}
swc_css_codegen_macros = {version = "0.2.0", path = "macros/"}
[dev-dependencies]
swc_css_parser = {version = "0.20.0", path = "../parser"}
swc_css_visit = {version = "0.17.0", path = "../visit"}
swc_css_parser = {version = "0.21.0", path = "../parser"}
swc_css_visit = {version = "0.18.0", path = "../visit"}
testing = {version = "0.15.0", path = "../../testing"}

View File

@ -1,6 +1,5 @@
pub use self::emit::*;
use self::{ctx::Ctx, list::ListFormat};
use std::borrow::Cow;
pub use std::fmt::Result;
use swc_common::Spanned;
use swc_css_ast::*;
@ -686,11 +685,7 @@ where
#[emitter]
fn emit_unit(&mut self, n: &Unit) -> Result {
let s: Cow<_> = match &n.kind {
UnitKind::Px => Cow::Owned("px".into()),
UnitKind::Custom(s) => Cow::Borrowed(s),
};
self.wr.write_raw(Some(n.span), &s)?;
self.wr.write_raw(Some(n.span), &n.raw)?;
}
#[emitter]

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_parser"
repository = "https://github.com/swc-project/swc.git"
version = "0.20.0"
version = "0.21.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -17,11 +17,11 @@ bitflags = "1.2.1"
lexical = "5.2.2"
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_css_ast = {version = "0.18.0", path = "../ast"}
swc_css_ast = {version = "0.19.0", path = "../ast"}
unicode-xid = "0.2.2"
[dev-dependencies]
serde = "1.0.127"
serde_json = "1.0.66"
swc_css_visit = {version = "0.17.0", path = "../visit"}
swc_css_visit = {version = "0.18.0", path = "../visit"}
testing = {version = "0.15.0", path = "../../testing"}

View File

@ -383,14 +383,18 @@ where
// Unit
let value = Num { span, value, raw };
match bump!(self) {
Token::Ident { raw: unit, .. } => {
let kind = UnitKind::from(unit);
Token::Ident {
value: unit_value,
raw: unit_raw,
..
} => {
return Ok(Value::Unit(UnitValue {
span: span!(self, span.lo),
value,
unit: Unit {
span: unit_span,
kind,
value: unit_value,
raw: unit_raw,
},
}));
}

View File

@ -96,7 +96,8 @@
"end": 34,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],
@ -161,7 +162,8 @@
"end": 54,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],
@ -226,7 +228,8 @@
"end": 74,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],
@ -310,7 +313,8 @@
"end": 102,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],
@ -394,7 +398,8 @@
"end": 129,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],
@ -478,7 +483,8 @@
"end": 156,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],

View File

@ -104,7 +104,8 @@
"end": 18,
"ctxt": 0
},
"kind": "p\\32x"
"value": "p2x",
"raw": "p\\32x"
}
}
],

View File

@ -124,7 +124,8 @@
"end": 20,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -150,7 +151,8 @@
"end": 24,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],

View File

@ -104,7 +104,8 @@
"end": 17,
"ctxt": 0
},
"kind": "\\2cx"
"value": ",x",
"raw": "\\2cx"
}
}
],

View File

@ -104,7 +104,8 @@
"end": 17,
"ctxt": 0
},
"kind": "x\\2c "
"value": "x,",
"raw": "x\\2c "
}
}
],

View File

@ -104,7 +104,8 @@
"end": 17,
"ctxt": 0
},
"kind": "\\32x"
"value": "2x",
"raw": "\\32x"
}
}
],

View File

@ -104,7 +104,8 @@
"end": 17,
"ctxt": 0
},
"kind": "\\65m"
"value": "em",
"raw": "\\65m"
}
}
],

View File

@ -114,7 +114,8 @@
"end": 25,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -140,7 +141,8 @@
"end": 29,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -166,7 +168,8 @@
"end": 33,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -192,7 +195,8 @@
"end": 37,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{

View File

@ -62,7 +62,8 @@
"end": 24,
"ctxt": 0
},
"kind": "vw"
"value": "vw",
"raw": "vw"
}
}
],

View File

@ -124,7 +124,8 @@
"end": 19,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -150,7 +151,8 @@
"end": 23,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],

View File

@ -104,7 +104,8 @@
"end": 16,
"ctxt": 0
},
"kind": "x\\,"
"value": "x,",
"raw": "x\\,"
}
}
],

View File

@ -62,7 +62,8 @@
"end": 28,
"ctxt": 0
},
"kind": "vw"
"value": "vw",
"raw": "vw"
}
}
],

View File

@ -104,7 +104,8 @@
"end": 16,
"ctxt": 0
},
"kind": "\\,x"
"value": ",x",
"raw": "\\,x"
}
}
],

View File

@ -104,7 +104,8 @@
"end": 18,
"ctxt": 0
},
"kind": "e\\32x"
"value": "e2x",
"raw": "e\\32x"
}
}
],

View File

@ -177,7 +177,8 @@
"end": 66,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -438,7 +439,8 @@
"end": 271,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -489,7 +491,8 @@
"end": 312,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -540,7 +543,8 @@
"end": 360,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -591,7 +595,8 @@
"end": 403,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -693,7 +698,8 @@
"end": 473,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],

View File

@ -1127,7 +1127,8 @@
"end": 672,
"ctxt": 0
},
"kind": "e"
"value": "e",
"raw": "e"
}
}
],

View File

@ -181,7 +181,8 @@
"end": 69,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],
@ -356,7 +357,8 @@
"end": 137,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],
@ -512,7 +514,8 @@
"end": 198,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],
@ -668,7 +671,8 @@
"end": 259,
"ctxt": 0
},
"kind": "cm"
"value": "cm",
"raw": "cm"
}
}
],

View File

@ -123,7 +123,8 @@
"end": 25,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -198,7 +199,8 @@
"end": 44,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
"right": {
@ -224,7 +226,8 @@
"end": 50,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
}
@ -300,7 +303,8 @@
"end": 69,
"ctxt": 0
},
"kind": "em"
"value": "em",
"raw": "em"
}
},
"right": {
@ -402,7 +406,8 @@
"end": 93,
"ctxt": 0
},
"kind": "em"
"value": "em",
"raw": "em"
}
},
"right": {
@ -457,7 +462,8 @@
"end": 104,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
}
@ -541,7 +547,8 @@
"end": 123,
"ctxt": 0
},
"kind": "em"
"value": "em",
"raw": "em"
}
},
"right": {
@ -656,7 +663,8 @@
"end": 150,
"ctxt": 0
},
"kind": "em"
"value": "em",
"raw": "em"
}
},
"right": {
@ -825,7 +833,8 @@
"end": 189,
"ctxt": 0
},
"kind": "em"
"value": "em",
"raw": "em"
}
},
"right": {
@ -956,7 +965,8 @@
"end": 216,
"ctxt": 0
},
"kind": "em"
"value": "em",
"raw": "em"
}
},
"right": {
@ -1032,7 +1042,8 @@
"end": 230,
"ctxt": 0
},
"kind": "em"
"value": "em",
"raw": "em"
}
}
]

View File

@ -299,7 +299,8 @@
"end": 130,
"ctxt": 0
},
"kind": "em"
"value": "em",
"raw": "em"
}
}
],
@ -346,7 +347,8 @@
"end": 145,
"ctxt": 0
},
"kind": "ms"
"value": "ms",
"raw": "ms"
}
}
],

View File

@ -123,7 +123,8 @@
"end": 48,
"ctxt": 0
},
"kind": "ch"
"value": "ch",
"raw": "ch"
}
}
]
@ -169,7 +170,8 @@
"end": 65,
"ctxt": 0
},
"kind": "ch"
"value": "ch",
"raw": "ch"
}
}
]
@ -197,7 +199,8 @@
"end": 70,
"ctxt": 0
},
"kind": "fr"
"value": "fr",
"raw": "fr"
}
}
],

View File

@ -105,7 +105,8 @@
"end": 22,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -229,7 +230,8 @@
"end": 68,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
"right": {
@ -255,7 +257,8 @@
"end": 75,
"ctxt": 0
},
"kind": "rem"
"value": "rem",
"raw": "rem"
}
}
}

View File

@ -133,7 +133,8 @@
"end": 58,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -179,7 +180,8 @@
"end": 72,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -205,7 +207,8 @@
"end": 77,
"ctxt": 0
},
"kind": "fr"
"value": "fr",
"raw": "fr"
}
}
]

View File

@ -151,7 +151,8 @@
"end": 60,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]

View File

@ -133,7 +133,8 @@
"end": 46,
"ctxt": 0
},
"kind": "fr"
"value": "fr",
"raw": "fr"
}
}
]

View File

@ -161,7 +161,8 @@
"end": 68,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]

View File

@ -91,7 +91,8 @@
"end": 59,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -171,7 +172,8 @@
"end": 112,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],

View File

@ -54,7 +54,8 @@
"end": 24,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -117,7 +118,8 @@
"end": 53,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -171,7 +173,8 @@
"end": 76,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -218,7 +221,8 @@
"end": 99,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -283,7 +287,8 @@
"end": 128,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -337,7 +342,8 @@
"end": 151,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -391,7 +397,8 @@
"end": 174,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -438,7 +445,8 @@
"end": 197,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -504,7 +512,8 @@
"end": 230,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -568,7 +577,8 @@
"end": 259,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -622,7 +632,8 @@
"end": 282,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -669,7 +680,8 @@
"end": 304,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -734,7 +746,8 @@
"end": 333,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -788,7 +801,8 @@
"end": 356,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -835,7 +849,8 @@
"end": 378,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],

View File

@ -160,7 +160,8 @@
"end": 103,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -235,7 +236,8 @@
"end": 159,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -316,7 +318,8 @@
"end": 207,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -370,7 +373,8 @@
"end": 230,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -417,7 +421,8 @@
"end": 253,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -500,7 +505,8 @@
"end": 293,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -554,7 +560,8 @@
"end": 316,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -608,7 +615,8 @@
"end": 339,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],
@ -655,7 +663,8 @@
"end": 362,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],

View File

@ -123,7 +123,8 @@
"end": 26,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -190,7 +191,8 @@
"end": 46,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -286,7 +288,8 @@
"end": 73,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -320,7 +323,8 @@
"end": 79,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
"right": {
@ -406,7 +410,8 @@
"end": 104,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -474,7 +479,8 @@
"end": 116,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -503,7 +509,8 @@
"end": 122,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
}
@ -571,7 +578,8 @@
"end": 142,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -639,7 +647,8 @@
"end": 154,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -668,7 +677,8 @@
"end": 160,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
},
@ -737,7 +747,8 @@
"end": 172,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -766,7 +777,8 @@
"end": 178,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
},
@ -835,7 +847,8 @@
"end": 190,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -864,7 +877,8 @@
"end": 196,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
}
@ -932,7 +946,8 @@
"end": 216,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -999,7 +1014,8 @@
"end": 236,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -1095,7 +1111,8 @@
"end": 263,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -1129,7 +1146,8 @@
"end": 269,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
"right": {
@ -1215,7 +1233,8 @@
"end": 294,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -1283,7 +1302,8 @@
"end": 306,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -1312,7 +1332,8 @@
"end": 312,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
}
@ -1380,7 +1401,8 @@
"end": 332,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -1448,7 +1470,8 @@
"end": 344,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -1477,7 +1500,8 @@
"end": 350,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
},
@ -1546,7 +1570,8 @@
"end": 362,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -1575,7 +1600,8 @@
"end": 368,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
},
@ -1644,7 +1670,8 @@
"end": 380,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
]
@ -1673,7 +1700,8 @@
"end": 386,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
}

View File

@ -161,7 +161,8 @@
"end": 69,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
"right": {

View File

@ -129,7 +129,8 @@
"end": 66,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -223,7 +224,8 @@
"end": 120,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -317,7 +319,8 @@
"end": 177,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -404,7 +407,8 @@
"end": 229,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
},
{
@ -586,7 +590,8 @@
"end": 364,
"ctxt": 0
},
"kind": "deg"
"value": "deg",
"raw": "deg"
}
}
]

View File

@ -148,7 +148,8 @@
"end": 41,
"ctxt": 0
},
"kind": "x"
"value": "x",
"raw": "x"
}
}
]

View File

@ -54,7 +54,8 @@
"end": 24,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],

View File

@ -54,7 +54,8 @@
"end": 24,
"ctxt": 0
},
"kind": null
"value": "px",
"raw": "px"
}
}
],

View File

@ -6,18 +6,18 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_stylis"
repository = "https://github.com/swc-project/swc.git"
version = "0.17.0"
version = "0.18.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_css_ast = {version = "0.18.0", path = "../ast"}
swc_css_utils = {version = "0.15.0", path = "../utils/"}
swc_css_visit = {version = "0.17.0", path = "../visit"}
swc_css_ast = {version = "0.19.0", path = "../ast"}
swc_css_utils = {version = "0.16.0", path = "../utils/"}
swc_css_visit = {version = "0.18.0", path = "../visit"}
[dev-dependencies]
swc_css_codegen = {version = "0.18.0", path = "../codegen"}
swc_css_parser = {version = "0.20.0", path = "../parser"}
swc_css_codegen = {version = "0.19.0", path = "../codegen"}
swc_css_parser = {version = "0.21.0", path = "../parser"}
testing = {version = "0.15.0", path = "../../testing"}

View File

@ -6,11 +6,11 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_utils"
repository = "https://github.com/swc-project/swc.git"
version = "0.15.0"
version = "0.16.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_css_ast = {version = "0.18.0", path = "../ast"}
swc_css_visit = {version = "0.17.0", path = "../visit"}
swc_css_ast = {version = "0.19.0", path = "../ast"}
swc_css_visit = {version = "0.18.0", path = "../visit"}

View File

@ -6,12 +6,12 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_visit"
repository = "https://github.com/swc-project/swc.git"
version = "0.17.0"
version = "0.18.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_css_ast = {version = "0.18.0", path = "../ast/"}
swc_css_ast = {version = "0.19.0", path = "../ast/"}
swc_visit = {version = "0.2.6", path = "../../visit"}

View File

@ -62,7 +62,8 @@ define!({
pub struct Unit {
pub span: Span,
pub kind: UnitKind,
pub value: JsWord,
pub raw: JsWord,
}
pub enum Value {