Utilities
Text Color
The Text Color
utility provides a straightforward way to change the color of text content within UI elements, enhancing readability, emphasis, and aesthetic appeal.
Utility Class | USS Properties |
---|---|
text-transparent | color: rgba(0, 0, 0, 0); |
text-slate-50 | color: #F8FAFC; |
text-slate-100 | color: #F1F5F9; |
text-slate-200 | color: #E2E8F0; |
text-slate-300 | color: #CBD5E1; |
text-slate-400 | color: #94A3B8; |
text-slate-500 | color: #64748B; |
text-slate-600 | color: #475569; |
text-slate-700 | color: #334155; |
text-slate-800 | color: #1E293B; |
text-slate-900 | color: #0F172A; |
text-slate-950 | color: #020617; |
text-gray-50 | color: #F9FAFB; |
text-gray-100 | color: #F3F4F6; |
text-gray-200 | color: #E5E7EB; |
text-gray-300 | color: #D1D5DB; |
text-gray-400 | color: #9CA3AF; |
text-gray-500 | color: #6B7280; |
text-gray-600 | color: #4B5563; |
text-gray-700 | color: #374151; |
text-gray-800 | color: #1F2937; |
text-gray-900 | color: #111827; |
text-gray-950 | color: #030712; |
text-zinc-50 | color: #FAFAFA; |
text-zinc-100 | color: #F4F4F5; |
text-zinc-200 | color: #E4E4E7; |
text-zinc-300 | color: #D4D4D8; |
text-zinc-400 | color: #A1A1AA; |
text-zinc-500 | color: #71717A; |
text-zinc-600 | color: #52525B; |
text-zinc-700 | color: #3F3F46; |
text-zinc-800 | color: #27272A; |
text-zinc-900 | color: #18181B; |
text-zinc-950 | color: #09090B; |
text-neutral-50 | color: #FAFAFA; |
text-neutral-100 | color: #F5F5F5; |
text-neutral-200 | color: #E5E5E5; |
text-neutral-300 | color: #D4D4D4; |
text-neutral-400 | color: #A3A3A3; |
text-neutral-500 | color: #737373; |
text-neutral-600 | color: #525252; |
text-neutral-700 | color: #404040; |
text-neutral-800 | color: #262626; |
text-neutral-900 | color: #171717; |
text-neutral-950 | color: #0A0A0A; |
text-stone-50 | color: #FAFAF9; |
text-stone-100 | color: #F5F5F4; |
text-stone-200 | color: #E7E5E4; |
text-stone-300 | color: #D6D3D1; |
text-stone-400 | color: #A8A29E; |
text-stone-500 | color: #78716C; |
text-stone-600 | color: #57534E; |
text-stone-700 | color: #44403C; |
text-stone-800 | color: #292524; |
text-stone-900 | color: #1C1917; |
text-stone-950 | color: #0C0A09; |
text-red-50 | color: #FEF2F2; |
text-red-100 | color: #FEE2E2; |
text-red-200 | color: #FECACA; |
text-red-300 | color: #FCA5A5; |
text-red-400 | color: #F87171; |
text-red-500 | color: #EF4444; |
text-red-600 | color: #DC2626; |
text-red-700 | color: #B91C1C; |
text-red-800 | color: #991B1B; |
text-red-900 | color: #7F1D1D; |
text-red-950 | color: #450A0A; |
text-orange-50 | color: #FFF7ED; |
text-orange-100 | color: #FFEDD5; |
text-orange-200 | color: #FED7AA; |
text-orange-300 | color: #FDBA74; |
text-orange-400 | color: #FB923C; |
text-orange-500 | color: #F97316; |
text-orange-600 | color: #EA580C; |
text-orange-700 | color: #C2410C; |
text-orange-800 | color: #9A3412; |
text-orange-900 | color: #7C2D12; |
text-orange-950 | color: #431407; |
text-amber-50 | color: #FFFBEB; |
text-amber-100 | color: #FEF3C7; |
text-amber-200 | color: #FDE68A; |
text-amber-300 | color: #FCD34D; |
text-amber-400 | color: #FBBF24; |
text-amber-500 | color: #F59E0B; |
text-amber-600 | color: #D97706; |
text-amber-700 | color: #B45309; |
text-amber-800 | color: #92400E; |
text-amber-900 | color: #78350F; |
text-amber-950 | color: #451A03; |
text-yellow-50 | color: #FEFCE8; |
text-yellow-100 | color: #FEF9C3; |
text-yellow-200 | color: #FEF08A; |
text-yellow-300 | color: #FDE047; |
text-yellow-400 | color: #FACC15; |
text-yellow-500 | color: #EAB308; |
text-yellow-600 | color: #CA8A04; |
text-yellow-700 | color: #A16207; |
text-yellow-800 | color: #854D0E; |
text-yellow-900 | color: #713F12; |
text-yellow-950 | color: #422006; |
text-lime-50 | color: #F7FEE7; |
text-lime-100 | color: #ECFCCB; |
text-lime-200 | color: #D9F99D; |
text-lime-300 | color: #BEF264; |
text-lime-400 | color: #A3E635; |
text-lime-500 | color: #84CC16; |
text-lime-600 | color: #65A30D; |
text-lime-700 | color: #4D7C0F; |
text-lime-800 | color: #3F6212; |
text-lime-900 | color: #365314; |
text-lime-950 | color: #1A2E05; |
text-green-50 | color: #F0FDF4; |
text-green-100 | color: #DCFCE7; |
text-green-200 | color: #BBF7D0; |
text-green-300 | color: #86EFAC; |
text-green-400 | color: #4ADE80; |
text-green-500 | color: #22C55E; |
text-green-600 | color: #16A34A; |
text-green-700 | color: #15803D; |
text-green-800 | color: #166534; |
text-green-900 | color: #14532D; |
text-green-950 | color: #052E16; |
text-emerald-50 | color: #ECFDF5; |
text-emerald-100 | color: #D1FAE5; |
text-emerald-200 | color: #A7F3D0; |
text-emerald-300 | color: #6EE7B7; |
text-emerald-400 | color: #34D399; |
text-emerald-500 | color: #10B981; |
text-emerald-600 | color: #059669; |
text-emerald-700 | color: #047857; |
text-emerald-800 | color: #065F46; |
text-emerald-900 | color: #064E3B; |
text-emerald-950 | color: #022C22; |
text-teal-50 | color: #F0FDFA; |
text-teal-100 | color: #CCFBF1; |
text-teal-200 | color: #99F6E4; |
text-teal-300 | color: #5EEAD4; |
text-teal-400 | color: #2DD4BF; |
text-teal-500 | color: #14B8A6; |
text-teal-600 | color: #0D9488; |
text-teal-700 | color: #0F766E; |
text-teal-800 | color: #115E59; |
text-teal-900 | color: #134E4A; |
text-teal-950 | color: #042F2E; |
text-cyan-50 | color: #ECFEFF; |
text-cyan-100 | color: #CFFAFE; |
text-cyan-200 | color: #A5F3FC; |
text-cyan-300 | color: #67E8F9; |
text-cyan-400 | color: #22D3EE; |
text-cyan-500 | color: #06B6D4; |
text-cyan-600 | color: #0891B2; |
text-cyan-700 | color: #0E7490; |
text-cyan-800 | color: #155E75; |
text-cyan-900 | color: #164E63; |
text-cyan-950 | color: #083344; |
text-sky-50 | color: #F0F9FF; |
text-sky-100 | color: #E0F2FE; |
text-sky-200 | color: #BAE6FD; |
text-sky-300 | color: #7DD3FC; |
text-sky-400 | color: #38BDF8; |
text-sky-500 | color: #0EA5E9; |
text-sky-600 | color: #0284C7; |
text-sky-700 | color: #0369A1; |
text-sky-800 | color: #075985; |
text-sky-900 | color: #0C4A6E; |
text-sky-950 | color: #082F49; |
text-blue-50 | color: #EFF6FF; |
text-blue-100 | color: #DBEAFE; |
text-blue-200 | color: #BFDBFE; |
text-blue-300 | color: #93C5FD; |
text-blue-400 | color: #60A5FA; |
text-blue-500 | color: #3B82F6; |
text-blue-600 | color: #2563EB; |
text-blue-700 | color: #1D4ED8; |
text-blue-800 | color: #1E40AF; |
text-blue-900 | color: #1E3A8A; |
text-blue-950 | color: #172554; |
text-indigo-50 | color: #EEF2FF; |
text-indigo-100 | color: #E0E7FF; |
text-indigo-200 | color: #C7D2FE; |
text-indigo-300 | color: #A5B4FC; |
text-indigo-400 | color: #818CF8; |
text-indigo-500 | color: #6366F1; |
text-indigo-600 | color: #4F46E5; |
text-indigo-700 | color: #4338CA; |
text-indigo-800 | color: #3730A3; |
text-indigo-900 | color: #312E81; |
text-indigo-950 | color: #1E1B4B; |
text-violet-50 | color: #F5F3FF; |
text-violet-100 | color: #EDE9FE; |
text-violet-200 | color: #DDD6FE; |
text-violet-300 | color: #C4B5FD; |
text-violet-400 | color: #A78BFA; |
text-violet-500 | color: #8B5CF6; |
text-violet-600 | color: #7C3AED; |
text-violet-700 | color: #6D28D9; |
text-violet-800 | color: #5B21B6; |
text-violet-900 | color: #4C1D95; |
text-violet-950 | color: #2E1065; |
text-purple-50 | color: #FAF5FF; |
text-purple-100 | color: #F3E8FF; |
text-purple-200 | color: #E9D5FF; |
text-purple-300 | color: #D8B4FE; |
text-purple-400 | color: #C084FC; |
text-purple-500 | color: #A855F7; |
text-purple-600 | color: #9333EA; |
text-purple-700 | color: #7E22CE; |
text-purple-800 | color: #6B21A8; |
text-purple-900 | color: #581C87; |
text-purple-950 | color: #3B0764; |
text-fuchsia-50 | color: #FDF4FF; |
text-fuchsia-100 | color: #FAE8FF; |
text-fuchsia-200 | color: #F5D0FE; |
text-fuchsia-300 | color: #F0ABFC; |
text-fuchsia-400 | color: #E879F9; |
text-fuchsia-500 | color: #D946EF; |
text-fuchsia-600 | color: #C026D3; |
text-fuchsia-700 | color: #A21CAF; |
text-fuchsia-800 | color: #86198F; |
text-fuchsia-900 | color: #701A75; |
text-fuchsia-950 | color: #4A044E; |
text-pink-50 | color: #FDF2F8; |
text-pink-100 | color: #FCE7F3; |
text-pink-200 | color: #FBCFE8; |
text-pink-300 | color: #F9A8D4; |
text-pink-400 | color: #F472B6; |
text-pink-500 | color: #EC4899; |
text-pink-600 | color: #DB2777; |
text-pink-700 | color: #BE185D; |
text-pink-800 | color: #9D174D; |
text-pink-900 | color: #831843; |
text-pink-950 | color: #500724; |
text-rose-50 | color: #FFF1F2; |
text-rose-100 | color: #FFE4E6; |
text-rose-200 | color: #FECDD3; |
text-rose-300 | color: #FDA4AF; |
text-rose-400 | color: #FB7185; |
text-rose-500 | color: #F43F5E; |
text-rose-600 | color: #E11D48; |
text-rose-700 | color: #BE123C; |
text-rose-800 | color: #9F1239; |
text-rose-900 | color: #881337; |
text-rose-950 | color: #4C0519; |
Using Default Text Colors
By default, ZoboUI includes a variety of colors from the Colors
field in the Core
section of the Theme Config asset. These colors can be applied as text colors. You can also add your own custom colors or override the existing colors in the Theme Config asset.
Applying a Text Color
To set a color, use the text-{color}
class, where {color}
is the key for your chosen color. This class will apply the selected color to the text of an element.
Basic Usage in UXML
To apply a text color, simply add the corresponding class to your UI element. For example:
<ui:Label class="text-slate-500">Slate Text</ui:Label>
<ui:Label class="text-gray-400">Gray Text</ui:Label>
Customize
Modifier Variations
You can customize which modifier variations of the Text Color
utility are generated, such as pseudo-classes (e.g., hover
, focus
) and custom modifiers.
Text Color
utility by default:- hover
- focus
By fine-tuning the utility variations, you maintain control over your stylesheet's size and complexity, ensuring that only necessary styles are included. To update these values:
- Open the Theme Config Asset: Find the asset within your Unity project.
- Navigate to the 'Utilities' Section: Locate the
Text Color
utility. - Adjust Modifier Variations: Select which modifiers you want to be generated for the utility. Keep in mind that the order of the modifiers will affect the order and specificity of the generated USS classes.
Class Tags and Properties
The Text Color
utility generates classes based on predefined tags and their associated USS properties. While we recommend keeping these defaults for consistency and ease of reference in our documentation, you have the option to customize them to suit your project's specific needs.
These values are prepended to the defined values in this format tag-{value}
. If a tag is empty, the generated class will simply be the value by itself.
Here are the default tags and the USS properties they set for the Text Color
utility:
- text : color
To customize these tags and properties, you can edit the Tag Property Map
field for the Text Color
utility in the Theme Config asset. This allows you to define new tags or modify existing ones, thus tailoring the generated classes to your preferences.
Extending Core Fields
The Text Color
utility uses values from the following fields from the Core
section of the Theme Config asset:
- Colors
To customize or define these extended fields:
- Open the Theme Config Asset: Locate the asset within your Unity project.
- Navigate to the 'Utilities' Section: Find the
Text Color
utility. - Customize Extend Fields: Modify or add fields in the
Extend Fields
array to change the core configuration values that are extended. You'll only be able to extend fields of the same type.
Disable Utility
The Text Color
utility is enabled by default. You can disable it by unchecking the Enabled
option in the Theme Config asset. This will prevent the generation of the utility's styles.