Skip to content

Commit 903d475

Browse files
committed
update wording
1 parent 12ce689 commit 903d475

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.changeset/wise-dots-rush.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"@biomejs/biome": patch
33
---
44

5-
Update CSS formatting of dimensions to use correct casing for Q, Hz and kHz
5+
Update CSS formatting of dimension units to use correct casing for Q, Hz and kHz
66

77
**Before:**
88

crates/biome_css_formatter/src/css/value/regular_dimension.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{prelude::*, utils::string_utils::FormatDimension};
1+
use crate::{prelude::*, utils::string_utils::FormatDimensionUnit};
22
use biome_css_syntax::{CssRegularDimension, CssRegularDimensionFields};
33
use biome_formatter::{token::number::NumberFormatOptions, write};
44

@@ -15,7 +15,7 @@ impl FormatNodeRule<CssRegularDimension> for FormatCssRegularDimension {
1515
f,
1616
[
1717
format_number_token(&value_token?, NumberFormatOptions::default()),
18-
FormatDimension::from(unit_token?),
18+
FormatDimensionUnit::from(unit_token?),
1919
]
2020
)
2121
}

crates/biome_css_formatter/src/css/value/unknown_dimension.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
22
prelude::*,
3-
utils::string_utils::{FormatDimension, FormatTokenAsLowercase},
3+
utils::string_utils::{FormatDimensionUnit, FormatTokenAsLowercase},
44
};
55
use biome_css_syntax::{CssUnknownDimension, CssUnknownDimensionFields};
66
use biome_formatter::write;
@@ -18,7 +18,7 @@ impl FormatNodeRule<CssUnknownDimension> for FormatCssUnknownDimension {
1818
f,
1919
[
2020
FormatTokenAsLowercase::from(value_token?),
21-
FormatDimension::from(unit_token?),
21+
FormatDimensionUnit::from(unit_token?),
2222
]
2323
);
2424
var_name

crates/biome_css_formatter/src/utils/string_utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,17 @@ impl<'token> LiteralStringNormaliser<'token> {
297297
}
298298
}
299299

300-
pub(crate) struct FormatDimension {
300+
pub(crate) struct FormatDimensionUnit {
301301
token: SyntaxToken<CssLanguage>,
302302
}
303303

304-
impl From<SyntaxToken<CssLanguage>> for FormatDimension {
304+
impl From<SyntaxToken<CssLanguage>> for FormatDimensionUnit {
305305
fn from(value: SyntaxToken<CssLanguage>) -> Self {
306306
Self { token: value }
307307
}
308308
}
309309

310-
impl Format<CssFormatContext> for FormatDimension {
310+
impl Format<CssFormatContext> for FormatDimensionUnit {
311311
fn fmt(&self, f: &mut CssFormatter) -> FormatResult<()> {
312312
let original = self.token.text_trimmed();
313313
match original.to_ascii_lowercase_cow() {
@@ -318,7 +318,7 @@ impl Format<CssFormatContext> for FormatDimension {
318318
[format_replaced(
319319
&self.token,
320320
&text(
321-
// Most CSS dimensions can be formatted as lower case, but there are
321+
// Most CSS dimension units can be formatted as lower case, but there are
322322
// a few that are more commonly formatted with some uppercase characters.
323323
// This maps those few cases to the correct casing. This matches the
324324
// behavior of the Prettier formatter.

0 commit comments

Comments
 (0)