Skip to content

forms plugin missing? #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
itsyoshio opened this issue Jan 8, 2022 · 2 comments
Closed

forms plugin missing? #128

itsyoshio opened this issue Jan 8, 2022 · 2 comments

Comments

@itsyoshio
Copy link

I'm not sure i quite get the gist of this, since there's barely any tutorials out on Rails 7 with Importmaps yet.

What i'm trying to achieve is using importmaps with tailwindcss (this gem) AND the /forms plugin.
The Generated tailwind.config.js has require('@tailwindcss/forms') in it, but i don't think its actually working.

the precompiled tailwind.css seems to be lacking these rules.

Any help would be appreciated.

@dixpac
Copy link
Contributor

dixpac commented Jan 8, 2022

This engine works fine with import-maps. We wrap https://tailwindcss.com/blog/standalone-cli to build tailwind.css.

tailwindcss/forms styles should be present inside the build css file. For example you should be able to find:

# app/assets/builds/tailwind.css

[type='checkbox']:focus,[type='radio']:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
  --tw-ring-offset-width: 2px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: #2563eb;
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}

You can try to generate one scaffold with a checkbox field and see the difference when tailwindcss/forms are required or not.

Hope this helps.

@itsyoshio
Copy link
Author

I figured it out two minutes ago, not expecting to get an answer this soon.
Regardless, your comment still helped clarify it for me further.

This is what happens when i try to change up more than one component at a time.
(Tailwind an Rails7 Importmaps)

Thank you so much @dixpac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants