React Tailwindcss- background color and text are the same size - reactjs

The backgound color is too close to the text. I have no idea why it is like that
I have searched the documents for help but cant seem to find a solution

use padding from tailwind css for text "p-5"

Related

Making a background-colorful text in React text editor

I am working on comparing files. So if something was added - I make it green, if deleted - red. And I do that on the server-side by adding a span tag and style attribute. Then I want to show it on the front side with some of React text editors by initializing an initial state with this file. The problem is that text editors cut style attributes, so my text is not with color. And I need to show a job of files comparator.
Thanks for any help :)

How to force antd tabs to be full height even if no content (with React and styled components)

I have a react app that uses ant design and styled components and am trying to get antd tabs to render the full height available but setting height to 100% or min-height to 100% is not working, however if I set 100vh it works... but this (of course) does not give the result I want because the component I am trying to render is not the full height of the screen.
Does anyone have experience with ant design that might have a good trick? I've looked at some solutions here on stack overflow but they do not seem to work. One was to use a row and col (here). I've also read through issues on github that suggest to target the specific antd classes like this one but it also does not seem to work.
Finally, I have a code sandbox link here that I have taken directly from ant design's site and added a style prop to the TabPane, setting the height and background (just to be able to see the effect) if someone would like to fiddle with it.
Please chime in if you have experience and a definite solution or even a suggestion at this point. Thanks in advance.
you can do with height : 100vh property .with appropriate padding .
here is the code sandbox link for the same .
https://codesandbox.io/s/bold-silence-d02qi?file=/index.js:2079-2088

Image or font awesome as option in select - Reactjs

I would like to have an input select with a choice of image as an option (would define a custom icon). I can put an image or an icon with Font awesome.
I tried putting
<select>
<option><i class='fas fa-shopping-bag'/></option>
<select>
or replace with an image but nothing work.
Font Awesome font is well imported, I tried with unicode it does not work either
Do you know how to do it ?
Thanks
if you are using reactjs you need to use className instead of class https://reactjs.org/docs/faq-styling.html

Finite Icon Colors in Draftail Editor

I am trying to implement a finite number of colors (like square icons) on the Draftail editor itself. What will be the best way to approach this?
It should be similar to how Microsoft Word displays the font color or something along those lines.
Thanks in advance.
I'm not sure if it's the best approach but here is what I came up with:
https://gist.github.com/benoitvogel/46022124d46de03ed2078603fb24ca97
This defines a new inline style which encloses the selected text between <span class="mycustomclass"></span> (change feature_name according to the CSS class you want to use).
Then, you just have to define the corresponding .mycustomstyle CSS class in your frontend as usual:
.mycustomstyle {
color: purple;
}
You can also modify control['style'] to change the way this style will be displayed in the editor.
You will get 1 icon/label per CSS class, so it's not really like in Word as you won't get a proper selector. I haven't tried it myself, but according to Wagtail docs icon can reference SVG, so you might be able to display color squares instead of labels.
Hope it fits your needs.

Lightbox2 - How to add a description to the open image (not caption)

I'm having some trouble adding text to the open lightbox image using HTML and CSS. I thought it was a caption but eventually figured out that's not it. Here's myy code:
<a href="img/portfolio/greenleavesbranding.png" data-lightbox="roadtrip"> <img class="artworkimg" src="img/portfolio/greenleavesthumb.png">
Currently theres no CSS as everything I've tried has failed so I've gotten rid of the code I don't need. But the text needs to be white and changed to my current font family.
I'm not an advanced coder, I know enough to modify HTML templates and add CSS.
Here's a screenshot - the red X is where I want the text to be.
Any help is greatly appreciated and thanks in advance!

Resources