css-styling
Personal backup of Claude Code skills and plugins
5 stars0 forksUpdated Jan 26, 2026
npx skills add https://github.com/vapvarun/claude-backup --skill css-stylingSKILL.md
CSS Styling Skill
Instructions
When writing CSS:
1. Modern CSS Reset
*, *::before, *::after {
box-sizing: border-box;
}
* {
margin: 0;
padding: 0;
}
html {
-webkit-text-size-adjust: none;
text-size-adjust: none;
}
body {
min-height: 100vh;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
img, picture, video, canvas, svg {
display: block;
max-width: 100%;
}
input, button, textarea, select {
font: inherit;
}
p, h1, h2, h3, h4, h5, h6 {
overflow-wrap: break-word;
}
2. CSS Custom Properties (Variables)
:root {
/* Colors */
--color-primary: #2563eb;
--color-primary-dark: #1d4ed8;
--color-secondary: #64748b;
--color-success: #22c55e;
--color-error: #ef4444;
/* Typography */
--font-sans: system-ui, -apple-system, sans-serif;
--font-mono: ui-monospace, monospace;
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
--text-3xl: 1.875rem;
/* Spacing */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-12: 3rem;
--space-16: 4rem;
/* Borders */
--radius-sm: 0.25rem;
--radius-md: 0.375rem;
--radius-lg: 0.5rem;
--radius-full: 9999px;
/* Shadows */
--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
--shadow-md: 0 4px 6px rgba(0,0,0,0.1);
--shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
/* Transitions */
--transition-fast: 150ms ease;
--transition-normal: 300ms ease;
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
:root {
--color-bg: #0f172a;
--color-text: #f1f5f9;
}
}
3. Flexbox Layouts
/* Center anything */
.center {
display: flex;
justify-content: center;
align-items: center;
}
/* Space between */
.space-between {
display: flex;
justify-content: space-between;
align-items: center;
}
/* Stack vertically */
.stack {
display: flex;
flex-direction: column;
gap: var(--space-4);
}
/* Wrap items */
.flex-wrap {
display: flex;
flex-wrap: wrap;
gap: var(--space-4);
}
4. Grid Layouts
/* Auto-fit responsive grid */
.grid-auto {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: var(--space-6);
}
/* Fixed columns */
.grid-3 {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--space-4);
}
/* Sidebar layout */
.with-sidebar {
display: grid;
grid-template-columns: 300px 1fr;
gap: var(--space-8);
}
/* Holy grail layout */
.holy-grail {
display: grid;
grid-template:
"header header header" auto
"nav main aside" 1fr
"footer footer footer" auto
/ 200px 1fr 200px;
min-height: 100vh;
}
5. Responsive Design
/* Mobile-first breakpoints */
/* Base: Mobile */
@media (min-width: 640px) {
/* Tablet */
}
@media (min-width: 1024px) {
/* Desktop */
}
@media (min-width: 1280px) {
/* Large desktop */
}
/* Container queries */
.card-container {
container-type: inline-size;
}
@container (min-width: 400px) {
.card {
display: flex;
}
}
/* Clamp for fluid typography */
h1 {
font-size: clamp(2rem, 5vw, 4rem);
}
6. Common Components
Buttons:
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
padding: var(--space-3) var(--space-6);
font-weight: 500;
border-radius: var(--radius-md);
border: none;
cursor: pointer;
transition: all var(--transition-fast);
}
.btn-primary {
background: var(--color-primary);
color: white;
}
.btn-primary:hover {
background: var(--color-primary-dark);
}
.btn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
Cards:
.card {
background: white;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-md);
overflow: hidden;
}
.card-body {
padding: var(--space-6);
}
.card-title {
font-size: var(--text-xl);
font-weight: 600;
margin-bottom: var(--space-2);
}
Forms:
.input {
width: 100%;
padding: var(--space-3) var(--space-4);
border: 1px solid #e2e8f0;
border-radius: var(--radius-md);
font-size: var(--text-base);
transition: border-color var(--transition-fast);
}
.input:focus {
outline: none;
border-color: var(--color-primary);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.input:invalid {
border-color: var(--color-error);
}
7. Animations
/* Fade in */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.fade-in {
animation: fadeIn var(--transition-normal) ease-out;
}
/* Slide up */
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.slide-up {
animation: slideUp var(--transition-normal) ease-out;
}
/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
...
Repository
vapvarun/claude-backupParent repository
Repository Stats
Stars5
Forks0