Theme Radius Tokens
Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 48 of 55.
A theme declaration --radius-card: 10px creates rounded-card, which curves all corners by 10 pixels. The namespace connects the variable to the radius utility family.
<div class="bg-black text-white p-4 rounded-card">Museum sample</div>@theme {
--radius-card: 10px;
--radius-tag: 6px;
--radius-frame: 18px;
--radius-tile: 22px;
}Changing that token updates every surface using its utility when the stylesheet is recompiled. Choose names for the design role rather than a specific color or pixel value so a later design change does not make the name misleading.
Challenge
MediumDefine a radius token named panel with value 14px and apply it to every corner of the schedule panel.
Keep the supplied content and element IDs. Edit the HTML utility classes or the requested CSS. Click Run preview to refresh the preview after edits, then use Check/Run code to grade your work.
Try it yourself
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Practice studio</title><link rel="stylesheet" href="./styles.css"></head><body>
<div id="target" class="bg-black text-white p-4">Schedule panel</div>
</body></html>
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1Meet Tailwind
A Styled First RunChoosing UtilitiesCombining UtilitiesThe Local StylesheetRecap: Meet Tailwind7Sizing and Overflow
Element WidthElement HeightMaximum WidthOverflow BehaviorRecap: Sizing and Overflow10Theme and Dark Mode
Theme Color TokensTheme Spacing TokensTheme Radius TokensClass-Based Dark ModeRecap: Theme and Dark Mode