Color Palette With Variables

Color Palette With Variables

Hard CSS Typography & Colors 17 views
Explanation Complexity

Problem Statement

Create 3 color variables and use them for background and text.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Use CSS variables and apply them.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use CSS variables and apply them.

Examples

Input:
Output:
(HTML+CSS code)

Example Solution (Public)

CSS
<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
  <style>
    :root { --bg: #0b1220; --text: #f7f7f7; --accent: #0b5; }
    body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, Arial, sans-serif; }
    a { color: var(--accent); }
    .wrap { padding: 18px; }
  </style>
</head>
<body>
  <div class='wrap'>
    <h1>meetcode</h1>
    <p>Dark theme preview.</p>
    <a href='#'>Start practice</a>
  </div>
</body>
</html>

Official Solution Code

<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
  <style>
    :root { --bg: #0b1220; --text: #f7f7f7; --accent: #0b5; }
    body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, Arial, sans-serif; }
    a { color: var(--accent); }
    .wrap { padding: 18px; }
  </style>
</head>
<body>
  <div class='wrap'>
    <h1>meetcode</h1>
    <p>Dark theme preview.</p>
    <a href='#'>Start practice</a>
  </div>
</body>
</html>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.