-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tailwind support for attr values (#122)
* feat: add tailwind support for attr values * update prettyplease * update docs * fix docs * cli arg 'requires' does not work together with 'default_value' * quote sorted tailwind class names
- Loading branch information
Showing
10 changed files
with
411 additions
and
368 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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 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 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 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 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 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 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,18 @@ | ||
use rustywind_core::sorter::{self, FinderRegex}; | ||
|
||
use crate::Formatter; | ||
|
||
impl Formatter<'_> { | ||
pub fn tailwind_expr(&mut self, attr_value: String) { | ||
static OPTIONS: sorter::Options = sorter::Options { | ||
regex: FinderRegex::DefaultRegex, | ||
sorter: sorter::Sorter::DefaultSorter, | ||
allow_duplicates: true, | ||
}; | ||
|
||
let sorted = sorter::sort_classes(&attr_value, &OPTIONS); | ||
self.printer.word("\""); | ||
self.printer.word(sorted); | ||
self.printer.word("\""); | ||
} | ||
} |
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
Oops, something went wrong.