Skip to content

Breakpoint not applying on text and header styles in v4 #17552

Answered by wongjn
fessor10 asked this question in Help
Discussion options

You must be logged in to vote
  1. Am I missing something in how I've defined my custom header classes?

Yes.

  1. Do I need to modify my Tailwind configuration to enable responsive variants for component classes?

Yes.

  1. Is there a different syntax I should be using for responsive variants with custom component classes?

Yes. Use @utility:

@utility header-4xl {
  @layer components {
    font-size: var(--header-4xl-font-size);
    line-height: var(--header-4xl-line-height);
    letter-spacing: var(--header-4xl-letter-spacing);
  }
}

@utility header-3xl {
  @layer components {
    font-size: var(--header-3xl-font-size);
    line-height: var(--header-3xl-line-height);
    letter-spacing: var(--header-3xl-letter-spacing);
…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fessor10
Comment options

@wongjn
Comment options

wongjn Apr 4, 2025
Collaborator

Answer selected by fessor10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants