Skip to content
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

Does not work with TailwindCSS anymore #311

Open
fmvilas opened this issue Oct 2, 2020 · 4 comments · May be fixed by #320
Open

Does not work with TailwindCSS anymore #311

fmvilas opened this issue Oct 2, 2020 · 4 comments · May be fixed by #320

Comments

@fmvilas
Copy link

fmvilas commented Oct 2, 2020

Is your feature request related to a problem? Please describe.
We're using TailwindCSS to style our website. Just upgraded this component for security reasons and found that lineNumberContainerProps and lineNumberProps were removed. Also, lineProps is not allowing us to pass custom classNames. That makes it impossible for us to use both Tailwind and this component.

You can see more here: https://github.com/asyncapi/website/blob/master/components/editor/CodeBlock.js#L61-L77.

Describe the solution you'd like
For lineNumberProps and lineNumberContainerProps either bring them back or maybe create something like lineNumberClassNames and lineNumberContainerClassNames. Happy to discuss what's better.

For lineProps, it seems the offending line is this one. Maybe this can be changed to:

properties.className = properties.className ? `${className} ${properties.className}` : className;

Describe alternatives you've considered
I've considered requiring the Tailwind configuration file from the component but that would couple the component to the config file, making it less reusable. Also considered hard-coding the values I want as inline styles but we'd get duplicated values in the config file and in this component.


Happy to help implementing the solution to this. Thanks for the great work! 🙌

@simmerer
Copy link
Collaborator

simmerer commented Oct 4, 2020

Good catch! Looks like there was a PR to get rid of lineNumberContainerStyle and lineNumberStyle and replace them with lineNumberContainerProps and lineNumberProps: #229 ... but somehow it was regressed with the 13.0.0 update.

If you've got a bit of time to implement a solution, we'd be grateful.

@fmvilas
Copy link
Author

fmvilas commented Oct 6, 2020

Absolutely. Do you want me to cherry pick the changes on #229?

@simmerer
Copy link
Collaborator

simmerer commented Oct 6, 2020

Go for it!

@SalahAdDin
Copy link

@simmerer I'm having problems with it too.

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