diff --git a/README.md b/README.md index 5dd5961..af315f4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,13 @@ Tailwindcss::Style.new(bg: :red).to_s Tailwindcss::Style.new(bg: :red, text: :white).to_s # => "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 Tailwindcss::Style.new(bg: :red, text: :white, _hover: {bg: :blue}).to_s # => "bg-red-500 text-white hover:bg-blue-500" @@ -39,20 +45,20 @@ You can configure the gem by creating an initializer file in your rails app. Tailwindcss.configure do |config| config.package_json_path = "./package.json" config.config_file_path = "./tailwind.config.js" - config.compiler.output_path = "./public/assets/styles.css" - config.compiler.compile_classes_dir = "./tmp/tailwindcss" - config.content = [] - config.prefix = "" - config.watch_content = false - config.breakpoints = %i[xs sm md lg xl 2xl] - config.pseudo_selectors = %i[hover focus active visited disabled first last first_of_type last_of_type odd even group_hover] - config.pseudo_elements = %i[before after file first_letter first_line selection backdrop marker] - config.logger = Logger.new(STDOUT) - config.theme.color_scheme = { - primary: :red, - secondary: :blue, - tertiary: :green - } - # other theme configurations + config.compiler.output_path = "./public/assets/styles.css" + config.compiler.compile_classes_dir = "./tmp/tailwindcss" + config.content = [] + config.prefix = "" + config.watch_content = false + config.breakpoints = %i[xs sm md lg xl 2xl] + config.pseudo_selectors = %i[hover focus active visited disabled first last first_of_type last_of_type odd even group_hover] + config.pseudo_elements = %i[before after file first_letter first_line selection backdrop marker] + config.logger = Logger.new(STDOUT) + config.theme.color_scheme = { + primary: :red, + secondary: :blue, + tertiary: :green + } + # other theme configurations end ```