-
-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(css_parser): add :local and :global pseudo class. #3011
- Loading branch information
1 parent
1e813c6
commit 1fbc42e
Showing
58 changed files
with
3,247 additions
and
502 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
crates/biome_css_formatter/src/css/any/keyframes_identifier.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. | ||
|
||
use crate::prelude::*; | ||
use biome_css_syntax::AnyCssKeyframesIdentifier; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatAnyCssKeyframesIdentifier; | ||
impl FormatRule<AnyCssKeyframesIdentifier> for FormatAnyCssKeyframesIdentifier { | ||
type Context = CssFormatContext; | ||
fn fmt(&self, node: &AnyCssKeyframesIdentifier, f: &mut CssFormatter) -> FormatResult<()> { | ||
match node { | ||
AnyCssKeyframesIdentifier::CssCustomIdentifier(node) => node.format().fmt(f), | ||
AnyCssKeyframesIdentifier::CssString(node) => node.format().fmt(f), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. | ||
|
||
use crate::prelude::*; | ||
use biome_css_syntax::AnyCssKeyframesName; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatAnyCssKeyframesName; | ||
impl FormatRule<AnyCssKeyframesName> for FormatAnyCssKeyframesName { | ||
type Context = CssFormatContext; | ||
fn fmt(&self, node: &AnyCssKeyframesName, f: &mut CssFormatter) -> FormatResult<()> { | ||
match node { | ||
AnyCssKeyframesName::AnyCssKeyframesIdentifier(node) => node.format().fmt(f), | ||
AnyCssKeyframesName::CssBogusKeyframesName(node) => node.format().fmt(f), | ||
AnyCssKeyframesName::CssKeyframesScopedName(node) => node.format().fmt(f), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. | ||
|
||
use crate::prelude::*; | ||
use biome_css_syntax::AnyCssKeyframesScope; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatAnyCssKeyframesScope; | ||
impl FormatRule<AnyCssKeyframesScope> for FormatAnyCssKeyframesScope { | ||
type Context = CssFormatContext; | ||
fn fmt(&self, node: &AnyCssKeyframesScope, f: &mut CssFormatter) -> FormatResult<()> { | ||
match node { | ||
AnyCssKeyframesScope::CssKeyframesScopeFunction(node) => node.format().fmt(f), | ||
AnyCssKeyframesScope::CssKeyframesScopePrefix(node) => node.format().fmt(f), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
crates/biome_css_formatter/src/css/auxiliary/keyframes_scope_function.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssKeyframesScopeFunction, CssKeyframesScopeFunctionFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssKeyframesScopeFunction; | ||
impl FormatNodeRule<CssKeyframesScopeFunction> for FormatCssKeyframesScopeFunction { | ||
fn fmt_fields( | ||
&self, | ||
node: &CssKeyframesScopeFunction, | ||
f: &mut CssFormatter, | ||
) -> FormatResult<()> { | ||
let CssKeyframesScopeFunctionFields { | ||
scope, | ||
l_paren_token, | ||
name, | ||
r_paren_token, | ||
} = node.as_fields(); | ||
|
||
write!( | ||
f, | ||
[ | ||
scope.format(), | ||
l_paren_token.format(), | ||
name.format(), | ||
r_paren_token.format(), | ||
] | ||
) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
crates/biome_css_formatter/src/css/auxiliary/keyframes_scope_prefix.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssKeyframesScopePrefix, CssKeyframesScopePrefixFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssKeyframesScopePrefix; | ||
impl FormatNodeRule<CssKeyframesScopePrefix> for FormatCssKeyframesScopePrefix { | ||
fn fmt_fields(&self, node: &CssKeyframesScopePrefix, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssKeyframesScopePrefixFields { scope, name } = node.as_fields(); | ||
|
||
write!(f, [scope.format(), space(), name.format(),]) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
crates/biome_css_formatter/src/css/auxiliary/keyframes_scoped_name.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssKeyframesScopedName, CssKeyframesScopedNameFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssKeyframesScopedName; | ||
impl FormatNodeRule<CssKeyframesScopedName> for FormatCssKeyframesScopedName { | ||
fn fmt_fields(&self, node: &CssKeyframesScopedName, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssKeyframesScopedNameFields { colon_token, scope } = node.as_fields(); | ||
|
||
write!(f, [colon_token.format(), scope.format(),]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
crates/biome_css_formatter/src/css/bogus/bogus_keyframes_name.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use crate::FormatBogusNodeRule; | ||
use biome_css_syntax::CssBogusKeyframesName; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssBogusKeyframesName; | ||
impl FormatBogusNodeRule<CssBogusKeyframesName> for FormatCssBogusKeyframesName {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 18 additions & 3 deletions
21
crates/biome_css_formatter/src/css/statements/value_at_rule.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::CssValueAtRule; | ||
use biome_rowan::AstNode; | ||
use biome_css_syntax::{CssValueAtRule, CssValueAtRuleFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssValueAtRule; | ||
impl FormatNodeRule<CssValueAtRule> for FormatCssValueAtRule { | ||
fn fmt_fields(&self, node: &CssValueAtRule, f: &mut CssFormatter) -> FormatResult<()> { | ||
format_verbatim_node(node.syntax()).fmt(f) | ||
let CssValueAtRuleFields { | ||
value_token, | ||
clause, | ||
semicolon_token, | ||
} = node.as_fields(); | ||
|
||
write!( | ||
f, | ||
[ | ||
value_token.format(), | ||
space(), | ||
clause.format(), | ||
semicolon_token.format(), | ||
] | ||
) | ||
} | ||
} |
Oops, something went wrong.