Skip to content

Apply multiple font properties with the same name #402

@ceopaludetto

Description

@ceopaludetto

Description

In tailwindcss@v3 it is possbile to configure fonts in this way:

theme: {
  fontFamily: {
    sans: ["Inter"]
  },
  fontSize: {
    "label-large": [14, { fontWeight: 500, letterSpacing: 0.5, lineHeight: 20 }]
  }
}

Which roughly generates the following:

<p class="text-label-large">Hi</p>
.text-label-large {
  font-family: Inter;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5;
  line-height: 20;
}

So I tried to do the same in @master/css@v2 with the following:

variables: {
  "font-family": {
    test: ["arial", "sans-serif"],
  },
  "font-weight": {
    test: 500,
  },
  "font-size": {
    test: 20,
  },
  "line-height": {
    test: 1.5,
  },
}

But due to name collision, only font-weight is applied:

<p class="font:test">Hi</p>
.font\:test {
  font-weight: 500;
}

It is possible to achieve the same functionality? This can be really useful to implement material 3 typography scale system

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions