Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(css/codegen): do not use raw #6674

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
75c7a87
refactor: test
alexander-akait Dec 18, 2022
a69c965
refactor: do not use raw for integers
alexander-akait Dec 18, 2022
8c8701a
refactor: less raw
alexander-akait Dec 18, 2022
c681d2a
refactor: less raw
alexander-akait Dec 18, 2022
eb956ac
refactor: less raw
alexander-akait Dec 18, 2022
ef9798e
refactor: less raw
alexander-akait Dec 18, 2022
5440fa6
refactor: less raw
alexander-akait Dec 18, 2022
5e17eac
fix: bug with unit of dimension
alexander-akait Dec 18, 2022
9422fe6
fix: bug with parsing wrong hex
alexander-akait Dec 18, 2022
9b3e001
fix: bug with string
alexander-akait Dec 18, 2022
1a4eec3
refactor: code
alexander-akait Dec 18, 2022
0a60e4b
refactor: code
alexander-akait Dec 18, 2022
5193233
test: update
alexander-akait Dec 18, 2022
54350bd
fix: bugs
alexander-akait Dec 18, 2022
6d51a60
refactor: code
alexander-akait Dec 18, 2022
def5294
fix: bug
alexander-akait Dec 18, 2022
c2cb911
feat: parse element function
alexander-akait Dec 18, 2022
57e99f6
fix: improve logic
alexander-akait Dec 18, 2022
510bcc7
fix: regression in hacks
alexander-akait Dec 18, 2022
197a0f7
test: update
alexander-akait Dec 18, 2022
2933094
refactor: code
alexander-akait Dec 18, 2022
6758d38
test: update
alexander-akait Dec 18, 2022
26a84c1
refactor: fix clippy
alexander-akait Dec 18, 2022
05b6712
refactor: rebase
alexander-akait Dec 19, 2022
5581c1c
test: update
alexander-akait Dec 19, 2022
983ff6a
refactor: rebase
alexander-akait Dec 20, 2022
4a49db2
refactor: rebase
alexander-akait Dec 20, 2022
7f8941f
refactor: rebase
alexander-akait Dec 21, 2022
d650b34
test: update
alexander-akait Dec 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 1 addition & 9 deletions crates/swc_atoms/words.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*
*
-infinity
-moz-activehyperlinktext
-moz-animation
Expand All @@ -12,8 +11,6 @@
-moz-animation-play-state
-moz-animation-timing-function
-moz-any
-moz-any
-moz-any
-moz-appearance
-moz-backface-visibility
-moz-background-origin
Expand All @@ -38,8 +35,6 @@
-moz-buttonhoverface
-moz-buttonhovertext
-moz-calc
-moz-calc
-moz-calc
-moz-cellhighlight
-moz-cellhighlighttext
-moz-column-count
Expand All @@ -59,9 +54,8 @@
-moz-dialog
-moz-dialogtext
-moz-document
-moz-document
-moz-document
-moz-dragtargetzone
-moz-element
-moz-eventreerow
-moz-font-feature-settings
-moz-font-language-override
Expand All @@ -71,8 +65,6 @@
-moz-hyperlinktext
-moz-hyphens
-moz-keyframes
-moz-keyframes
-moz-keyframes
-moz-mac-accentdarkestshadow
-moz-mac-accentdarkshadow
-moz-mac-accentface
Expand Down
8 changes: 5 additions & 3 deletions crates/swc_css_ast/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use swc_common::{ast_node, util::take::Take, EqIgnoreSpan, Span};

use crate::{
AlphaValue, AnglePercentage, AtRule, CalcSum, CmykComponent, Color, ComplexSelector,
DashedIdent, Delimiter, Dimension, FrequencyPercentage, Hue, Ident, Integer, KeyframeBlock,
LayerName, LengthPercentage, Number, Percentage, Ratio, RelativeSelectorList, SelectorList,
Str, SupportsCondition, TimePercentage, TokenAndSpan, UnicodeRange, Url,
DashedIdent, Delimiter, Dimension, FrequencyPercentage, Hue, IdSelector, Ident, Integer,
KeyframeBlock, LayerName, LengthPercentage, Number, Percentage, Ratio, RelativeSelectorList,
SelectorList, Str, SupportsCondition, TimePercentage, TokenAndSpan, UnicodeRange, Url,
};

#[ast_node("Stylesheet")]
Expand Down Expand Up @@ -218,6 +218,8 @@ pub enum ComponentValue {
SupportsCondition(Box<SupportsCondition>),
#[tag("Declaration")]
Declaration(Box<Declaration>),
#[tag("IdSelector")]
IdSelector(Box<IdSelector>),
kdy1 marked this conversation as resolved.
Show resolved Hide resolved
}

impl From<StyleBlock> for ComponentValue {
Expand Down
3 changes: 2 additions & 1 deletion crates/swc_css_codegen/src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ where

#[derive(Debug, Default, Clone, Copy)]
pub(crate) struct Ctx {
pub in_single_line_selectors: bool,
pub allow_to_lowercase: bool,
pub is_dimension_unit: bool,
pub in_single_line_selectors: bool,
pub in_list_of_component_values: bool,
}

Expand Down