How to change the font family in the Tailwind component
P粉037215587
P粉037215587 2023-09-14 20:18:29
0
1
517

I have a select component and I want to set a custom font, just like another input box

<select data-te-select-init data-te-select-font="14">
    <option value="0">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
  </select>3
P粉037215587
P粉037215587

reply all(1)
P粉347804896

Consider using the option classes to apply custom classes to select elements. This allows the font-family utility class to be used to apply the desired font-family.

For example, we can apply mono font-family to formOutline## by using the data-te-class-form-outline attribute # element, as shown below:

tailwind.config = {
  darkMode: "class"
  corePlugins: {
    preflight: false,
  },
};
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-elements/dist/css/tw-elements.min.css" />
<script src="https://cdn.tailwindcss.com/3.3.3"></script>

<select data-te-select-init data-te-select-font="14" data-te-class-form-outline="relative font-mono">
  <option value="0">0</option>
  <option value="1">1</option>
  <option value="2">2</option>
</select>3

<script src="https://cdn.jsdelivr.net/npm/tw-elements/dist/js/tw-elements.umd.min.js"></script>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template