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

An issue occurs when I customize font-size. #82

Open
Wisesaturn opened this issue Nov 10, 2022 · 10 comments
Open

An issue occurs when I customize font-size. #82

Wisesaturn opened this issue Nov 10, 2022 · 10 comments

Comments

@Wisesaturn
Copy link

Wisesaturn commented Nov 10, 2022

There is an error that results in priority when customizing the naming of the font size.

Normal

tailwind-styled-components Tag Normal Tag Result
image image image

Customize

tailwind-styled-components Tag Normal Tag
image image
Result tailwind.config.js
image image

Does anyone have the same issue as this?

@br14n-sol
Copy link

I have the same problem, were you able to solve it?

@Wisesaturn
Copy link
Author

I have the same problem, were you able to solve it?

Not yet. I just solved that temporarily by giving className outside the tag and only giving text effects.

@br14n-sol
Copy link

br14n-sol commented Dec 10, 2022

It seems to me that it might be a tailwind-merge problem, but I'm not entirely sure. 🤔

@Wisesaturn
Copy link
Author

It seems to me that it might be a tailwind-merge problem, but I'm not entirely sure. 🤔

Oh, Thanks :) I'll be check this out.
tailwind-merge

@CarlosMion
Copy link

any news on that?

@ivvv111
Copy link

ivvv111 commented Feb 4, 2023

@Wisesaturn Did you solve the problem?

@Wisesaturn
Copy link
Author

any news on that?
@Wisesaturn Did you solve the problem?

No, I'm just going on with it.

@rhkdgns95
Copy link

rhkdgns95 commented Jun 29, 2023

The bug occurs when:

// tailwind.config.js
const px0_10 = { ...Array.from(Array(11)).map((_, i) => `${i}px`) };
const px0_100 = { ...Array.from(Array(101)).map((_, i) => `${i}px`) };
const px0_200 = { ...Array.from(Array(201)).map((_, i) => `${i}px`) };
const px0_400 = { ...Array.from(Array(401)).map((_, i) => `${i}px`) };

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./src/components/**/*.{js,ts,jsx,tsx}",
    "./src/routers/**/*.{js,ts,jsx,tsx}",
    "./src/icons/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {
      fontFamily: {
        pretendard: ["Pretendard"],
        poppins: ["Poppins"],
      },
      borderWidth: px0_10,
      fontSize: px0_100,
      lineHeight: px0_100,
      minWidth: px0_200,
      minHeight: px0_200,
      spacing: px0_200,
      padding: px0_400,
    },
  },
  plugins: [],
};
// When text is repeatedly entered, only the last text-[white] value is applied.
const Text = tw.p`text-28 text-[white]`;

// When writing like this, only text-28 value is applied.
const OtherText = tw.p`text-[white] text-28`;

// When writing like this, Both text-[white] and text-[28px] are applied.
const OtherText = tw.p`text-[white] text-[28px]`;

Maybe, is there a solution?

@Wisesaturn
Copy link
Author

Wisesaturn commented Jun 30, 2023

@rhkdgns95
It's a bit of a hassle, but I think it's a good way

@rhkdgns95
Copy link

@Wisesaturn hmm.. Do you think so?

The issue has not been resolved yet, so I hope someone can suggest a way to solve it.

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

5 participants