From ce08edac744d1ec5e93b5d1349068c85edd13e04 Mon Sep 17 00:00:00 2001 From: Guilherme Andrade Date: Sun, 3 Nov 2024 03:33:21 +0100 Subject: [PATCH] More fixes to docs --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fdaecd3..36747d7 100644 --- a/README.md +++ b/README.md @@ -40,18 +40,6 @@ tailwind(bg: :red, text: :white) # => "bg-red-500 text-white" ``` -### Modifiers - -Any key that starts with an underscore is considered a modifier. Modifiers are used to add pseudo classes and elements to the class. - -```ruby -tailwind(bg: :red, text: :white, _hover: { bg: :blue }) -# => "bg-red-500 text-white hover:bg-blue-500" - -tailwind(bg: :red, text: :white, _hover: { bg: :blue }, _before: { content: '[""]' }) -# => "bg-red-500 text-white hover:bg-blue-500 before:content-[\"\"]" -``` - ## Configuration You can configure the gem by creating an initializer file in your rails app. @@ -177,6 +165,19 @@ And these classes will be added by the tailwind compiler to the final css file. ## Advanced Usage +### Using Modifiers + +Any key that starts with an underscore is considered a modifier. Modifiers are used to add pseudo classes and elements to the class. + +```ruby +tailwind(bg: :red, text: :white, _hover: { bg: :blue }) +# => "bg-red-500 text-white hover:bg-blue-500" + +tailwind(bg: :red, text: :white, _hover: { bg: :blue }, _before: { content: '[""]' }) +# => "bg-red-500 text-white hover:bg-blue-500 before:content-[\"\"]" +``` + + ### Using arbitrary values When using arbitrary values, you have one of two options.