Skip to content

Instantly share code, notes, and snippets.

@phreakin
Last active May 26, 2025 13:37
Show Gist options
  • Save phreakin/c07542b84deaa64237c74c06bc3018de to your computer and use it in GitHub Desktop.
Save phreakin/c07542b84deaa64237c74c06bc3018de to your computer and use it in GitHub Desktop.
CSS color theme that applies to all form elements inside .theme-light scope
/* ===================================================================
Universal Light Theme Form Stylesheet
- Applies to all form elements inside .theme-light scope
- Modular, safe, and override-friendly
=================================================================== */
/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code&display=swap');
/* === Root Class for Theming Scope === */
.theme-light {
font-family: 'Fira Code', monospace;
background-color: #ffffff;
color: #1e1e1e;
}
/* === Inputs, Textareas, Selects === */
.theme-light input:not([type="hidden"]):not([type="file"]),
.theme-light select,
.theme-light textarea {
background-color: #ffffff;
color: #1e1e1e;
border: 1px solid #1e1e1e;
border-radius: 6px;
accent-color: #1e1e1e;
padding: 0.5rem;
transition: all 0.3s ease;
}
/* === Buttons === */
.theme-light button,
.theme-light input[type="submit"],
.theme-light input[type="button"] {
background-color: #1e1e1e;
color: #ffffff;
border: 1px solid #1e1e1e;
padding: 0.5rem 1rem;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s ease, color 0.3s ease;
}
.theme-light button:hover,
.theme-light input[type="submit"]:hover,
.theme-light input[type="button"]:hover {
background-color: #333333;
}
/* === Disabled State === */
.theme-light input:disabled,
.theme-light select:disabled,
.theme-light textarea:disabled {
background-color: #f4f4f4;
color: #aaa;
border-color: #ccc;
}
/* === Focus State === */
.theme-light input:focus,
.theme-light select:focus,
.theme-light textarea:focus {
border-color: #333333;
box-shadow: 0 0 0 2px #33333355;
outline: none;
}
/* === Labels, Fieldset, Legend === */
.theme-light label,
.theme-light fieldset,
.theme-light legend {
color: #1e1e1e;
font-weight: bold;
border-color: #1e1e1e;
}
/* === Feedback === */
.theme-light .form-text,
.theme-light .invalid-feedback,
.theme-light .valid-feedback {
font-size: 0.875rem;
margin-top: 0.25rem;
}
.theme-light .invalid-feedback {
color: #dc2626;
}
.theme-light .valid-feedback {
color: #16a34a;
}
/* === File Upload Button === */
.theme-light input[type="file"]::-webkit-file-upload-button {
background-color: #1e1e1e;
color: #fff;
border: 1px solid #1e1e1e;
cursor: pointer;
transition: background-color 0.3s ease;
}
.theme-light input[type="file"]::-webkit-file-upload-button:hover {
background-color: #333333;
}
/* === Range Slider === */
.theme-light input[type="range"] {
background-color: #fff;
border: 1px solid #1e1e1e;
accent-color: #1e1e1e;
}
/* === Checkbox and Radio === */
.theme-light input[type="checkbox"],
.theme-light input[type="radio"] {
accent-color: #1e1e1e;
}
/* === Select Options === */
.theme-light option,
.theme-light optgroup {
background-color: #ffffff;
color: #1e1e1e;
}
/* === Progress & Meter === */
.theme-light progress,
.theme-light meter {
background-color: #ffffff;
color: #1e1e1e;
border: 1px solid #1e1e1e;
accent-color: #1e1e1e;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment