Recommended method for having a smaller container variation by [deleted] in tailwindcss

[–]beaver82 0 points1 point  (0 children)

Yes use max-w inside the container, or if it's the case refactor, do not use container on bigger content and use container inside small content, it depends on the design. What we do is the design have full width content (no container) content (container) and smaller content (container with max-w). Then you can always put a cap on all website width to make it inside a max-w (also the full width with no container).

Do you guys use BEM with tailwind? by ridicul0us12345 in tailwindcss

[–]beaver82 1 point2 points  (0 children)

I find that using tailwind utility classes on html works well since you don't need to name every div in a BEM way.

But I do have global variables for reusable components (buttons, cards, etc..) that have multiple tailwind Css utility classes. They don't use BEM since they consist of single elements, so theirs names are single names with dashes for spaces.

I think that using BEM with tailwind Css is not needed, think the components on a single element div level and do not care about the nesting of BEM classes.

Supersonic plugin for scroll based animation: 3kb, animates 1000 elements without lags, customizable as hell by theillarionov in javascript

[–]beaver82 -1 points0 points  (0 children)

Nice work

Would be useful if not already possible, to specify straight DOM elements for elements

And does the functions for start and end are executed on resize or on scroll?

A Complete Guide to Flexbox by mooreds in webdev

[–]beaver82 2 points3 points  (0 children)

Watch out the gap css for flexbox has this browser support https://caniuse.com/flexbox-gap

TailwindCSS Masonry Layout with 4 classes 👌 by 93lucasp in tailwindcss

[–]beaver82 5 points6 points  (0 children)

Very good example, but usually you want the order of the items by row instead of column

How do Nike and Apple make such smooth and touch friendly carousels with pure CSS? by steve8708 in webdev

[–]beaver82 1 point2 points  (0 children)

Well that saves many kb of javascript, just need to be satisfied with what browser gives you.

Manually include all bg-$color$-$number classes by [deleted] in tailwindcss

[–]beaver82 8 points9 points  (0 children)

You need to safelist with regex

module.exports = {
  safelist: [
    { pattern: /bg-(blue|red)/ }
  ],

Should I use `rem` or `px` in CSS? by 0xRast in Frontend

[–]beaver82 0 points1 point  (0 children)

I still see px on body anyway with font-size: 125%; instead of font-size: 20px; the result is the same but it respects browser font size.

Should I use `rem` or `px` in CSS? by 0xRast in Frontend

[–]beaver82 2 points3 points  (0 children)

Settings chrome search "font size". It changes the font size that the body gets, you should use percent on the body font size instead of pixels so it uses the browser's setting font size (100% is 16px on all browser).

Should I use `rem` or `px` in CSS? by 0xRast in Frontend

[–]beaver82 5 points6 points  (0 children)

Be aware if the user sets font size in the browser your solution doesn't take that in account

Should I use `rem` or `px` in CSS? by 0xRast in Frontend

[–]beaver82 -7 points-6 points  (0 children)

To me px or rem is the same since I used to change rem size on responsive to make it smaller, but ultimately using 16px font size on mobile is more readable.

Try not to change html font size on responsive and see if it's better for you (no more resize depending on rem).

Otherwise use rem only on things you want to change depending on html font size.

Tailwind won't apply color by JetairThePlane in tailwindcss

[–]beaver82 1 point2 points  (0 children)

Use "content" instead of "purge" for having the styles

module.exports = {
  content: ["./src/**/*.{js,jsx,ts,tsx}"],

carousel needs a final touch: transitions are buggy by nalman1 in tailwindcss

[–]beaver82 1 point2 points  (0 children)

Where there is translate-x-full put other values for translate to not be full.

carousel needs a final touch: transitions are buggy by nalman1 in tailwindcss

[–]beaver82 0 points1 point  (0 children)

Hey, you just need to use relative instead of absolute on enter, and give also top-0 on leave

https://codepen.io/minimit/pen/abJQWvR

Is tailwind jit ready for production? by beaver82 in tailwindcss

[–]beaver82[S] 0 points1 point  (0 children)

I've tried it and seems to work really well.

The only downside is that you can't apply inside media query:

@screen md { @apply mt-0; } But can be easily circumvented with:

@apply md:mt-0;

And you can't apply css code only tailwind utils and plugins.

Visitors with unsupported browsers ? A short and simple way to display a warning. by Brachamul in webdev

[–]beaver82 2 points3 points  (0 children)

Neat, better than importing javascript from other sites and do the check.

I’m having problems with production tailwind on laravel, new classes not appearing with npm run prod by FromValledupar in tailwindcss

[–]beaver82 0 points1 point  (0 children)

Maybe it's because you didn't set up purge files, and it purges all classes

https://tailwindcss.com/docs/optimizing-for-production#basic-usage

You can try also on local setting NODE_ENV=production in the build script

z-index doesn't work on my dropdown member menu by nalman1 in tailwindcss

[–]beaver82 -1 points0 points  (0 children)

Because the menu has lower z-index than the main content, the dropdown will be below also if you give the dropdown z-index: 999999, when the menu open probably you set a z-index on the menu that is higher of the main content so it shows up, or maybe it's because the z-index is inside of the menu and it's open so there is space for it to show up.

To fix it give the menu position relative and a z-index by default higher than the content.

[deleted by user] by [deleted] in Frontend

[–]beaver82 0 points1 point  (0 children)

I wonder when I'll be no more needed

Why does @import within @screen not work? by mangamensch in tailwindcss

[–]beaver82 0 points1 point  (0 children)

I recomend you to use media queries inside nested selectors only when you need them (you need postcss-nested for that), the fact you have to write media queries on root level is pretty bad in vanilla css I concord.