Skip to content

Commit

Permalink
feat(css_parser): Parse border exactly (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
faultyserver authored Jan 7, 2024
1 parent b5f5c08 commit 166cbab
Show file tree
Hide file tree
Showing 31 changed files with 2,844 additions and 83 deletions.
65 changes: 65 additions & 0 deletions crates/biome_css_factory/src/generated/node_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

118 changes: 118 additions & 0 deletions crates/biome_css_factory/src/generated/syntax_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions crates/biome_css_formatter/src/css/any/border_property_value.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//! 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::AnyCssBorderPropertyValue;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatAnyCssBorderPropertyValue;
impl FormatRule<AnyCssBorderPropertyValue> for FormatAnyCssBorderPropertyValue {
type Context = CssFormatContext;
fn fmt(&self, node: &AnyCssBorderPropertyValue, f: &mut CssFormatter) -> FormatResult<()> {
match node {
AnyCssBorderPropertyValue::CssBorder(node) => node.format().fmt(f),
AnyCssBorderPropertyValue::CssWideKeyword(node) => node.format().fmt(f),
AnyCssBorderPropertyValue::CssUnknownPropertyValue(node) => node.format().fmt(f),
AnyCssBorderPropertyValue::CssBogusPropertyValue(node) => node.format().fmt(f),
}
}
}
15 changes: 15 additions & 0 deletions crates/biome_css_formatter/src/css/any/line_width.rs
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::AnyCssLineWidth;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatAnyCssLineWidth;
impl FormatRule<AnyCssLineWidth> for FormatAnyCssLineWidth {
type Context = CssFormatContext;
fn fmt(&self, node: &AnyCssLineWidth, f: &mut CssFormatter) -> FormatResult<()> {
match node {
AnyCssLineWidth::CssRegularDimension(node) => node.format().fmt(f),
AnyCssLineWidth::CssLineWidthKeyword(node) => node.format().fmt(f),
}
}
}
2 changes: 2 additions & 0 deletions crates/biome_css_formatter/src/css/any/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pub(crate) mod all_property_value;
pub(crate) mod at_rule;
pub(crate) mod attribute_matcher_value;
pub(crate) mod border_property_value;
pub(crate) mod compound_selector;
pub(crate) mod container_and_combinable_query;
pub(crate) mod container_or_combinable_query;
Expand All @@ -27,6 +28,7 @@ pub(crate) mod keyframes_block;
pub(crate) mod keyframes_item;
pub(crate) mod keyframes_selector;
pub(crate) mod layer;
pub(crate) mod line_width;
pub(crate) mod media_and_combinable_condition;
pub(crate) mod media_condition;
pub(crate) mod media_in_parens;
Expand Down
1 change: 1 addition & 0 deletions crates/biome_css_formatter/src/css/any/property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ impl FormatRule<AnyCssProperty> for FormatAnyCssProperty {
AnyCssProperty::CssGenericProperty(node) => node.format().fmt(f),
AnyCssProperty::CssBogusProperty(node) => node.format().fmt(f),
AnyCssProperty::CssAllProperty(node) => node.format().fmt(f),
AnyCssProperty::CssBorderProperty(node) => node.format().fmt(f),
AnyCssProperty::CssZIndexProperty(node) => node.format().fmt(f),
}
}
Expand Down
10 changes: 10 additions & 0 deletions crates/biome_css_formatter/src/css/auxiliary/border.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::prelude::*;
use biome_css_syntax::CssBorder;
use biome_rowan::AstNode;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatCssBorder;
impl FormatNodeRule<CssBorder> for FormatCssBorder {
fn fmt_fields(&self, node: &CssBorder, f: &mut CssFormatter) -> FormatResult<()> {
format_verbatim_node(node.syntax()).fmt(f)
}
}
10 changes: 10 additions & 0 deletions crates/biome_css_formatter/src/css/auxiliary/line_style.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::prelude::*;
use biome_css_syntax::CssLineStyle;
use biome_rowan::AstNode;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatCssLineStyle;
impl FormatNodeRule<CssLineStyle> for FormatCssLineStyle {
fn fmt_fields(&self, node: &CssLineStyle, f: &mut CssFormatter) -> FormatResult<()> {
format_verbatim_node(node.syntax()).fmt(f)
}
}
10 changes: 10 additions & 0 deletions crates/biome_css_formatter/src/css/auxiliary/line_width_keyword.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::prelude::*;
use biome_css_syntax::CssLineWidthKeyword;
use biome_rowan::AstNode;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatCssLineWidthKeyword;
impl FormatNodeRule<CssLineWidthKeyword> for FormatCssLineWidthKeyword {
fn fmt_fields(&self, node: &CssLineWidthKeyword, f: &mut CssFormatter) -> FormatResult<()> {
format_verbatim_node(node.syntax()).fmt(f)
}
}
3 changes: 3 additions & 0 deletions crates/biome_css_formatter/src/css/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub(crate) mod attribute_matcher_value;
pub(crate) mod attribute_name;
pub(crate) mod auto;
pub(crate) mod binary_expression;
pub(crate) mod border;
pub(crate) mod container_and_query;
pub(crate) mod container_not_query;
pub(crate) mod container_or_query;
Expand All @@ -28,6 +29,8 @@ pub(crate) mod keyframes_block;
pub(crate) mod keyframes_item;
pub(crate) mod layer_declaration;
pub(crate) mod layer_reference;
pub(crate) mod line_style;
pub(crate) mod line_width_keyword;
pub(crate) mod list_of_component_values_expression;
pub(crate) mod media_and_condition;
pub(crate) mod media_and_type_query;
Expand Down
10 changes: 10 additions & 0 deletions crates/biome_css_formatter/src/css/properties/border_property.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::prelude::*;
use biome_css_syntax::CssBorderProperty;
use biome_rowan::AstNode;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatCssBorderProperty;
impl FormatNodeRule<CssBorderProperty> for FormatCssBorderProperty {
fn fmt_fields(&self, node: &CssBorderProperty, f: &mut CssFormatter) -> FormatResult<()> {
format_verbatim_node(node.syntax()).fmt(f)
}
}
1 change: 1 addition & 0 deletions crates/biome_css_formatter/src/css/properties/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file.
pub(crate) mod all_property;
pub(crate) mod border_property;
pub(crate) mod generic_property;
pub(crate) mod z_index_property;
Loading

0 comments on commit 166cbab

Please sign in to comment.