lab-theme.css
css4 kB278 linesIn React_Labs_Chapters_05_07.zip
React_Labs_Chapters_05_07.ziplab2-templatesrcstyleslab-theme.css
:root {
--bg: #f5f7fa;
--card-bg: #ffffff;
--text: #1a1c24;
--muted: #5f6680;
--accent: #2563eb;
--border: #d6dae5;
--success: #10b981;
--danger: #ef4444;
--warning: #f59e0b;
--button-bg: #2563eb;
--button-hover: #1d4ed8;
}
.lab-body {
margin: 0;
font-family: 'Segoe UI', Tahoma, sans-serif;
background-color: var(--bg);
color: var(--text);
}
.layout {
display: flex;
flex-direction: column;
gap: 1.5rem;
padding: 2rem;
max-width: 1200px;
margin: 0 auto;
}
.card {
background-color: var(--card-bg);
border: 1px solid var(--border);
border-radius: 1rem;
padding: 1.75rem;
box-shadow: 0 12px 24px -16px rgba(15, 23, 42, 0.2);
}
.banner {
background: linear-gradient(135deg, #2563eb 0%, #4338ca 100%);
color: #f8fafc;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
}
.heading-large {
margin: 0 0 0.5rem;
font-size: 2rem;
font-weight: 700;
}
.heading-medium {
margin: 0 0 1rem;
font-size: 1.5rem;
font-weight: 600;
}
.heading-small {
margin: 0;
font-size: 1.1rem;
font-weight: 600;
}
.meta {
color: rgba(248, 250, 252, 0.8);
margin: 0;
}
.products-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 1.5rem;
margin-top: 1rem;
}
.product-card {
border: 1px solid var(--border);
border-radius: 0.75rem;
padding: 1.25rem;
background-color: #f8fafc;
display: flex;
flex-direction: column;
gap: 0.75rem;
transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
transform: translateY(-2px);
box-shadow: 0 8px 16px -8px rgba(15, 23, 42, 0.3);
}
.product-image {
font-size: 3rem;
text-align: center;
margin-bottom: 0.5rem;
}
.product-name {
font-size: 1.25rem;
font-weight: 600;
margin: 0;
}
.product-description {
color: var(--muted);
font-size: 0.9rem;
margin: 0;
flex-grow: 1;
}
.product-price {
font-size: 1.5rem;
font-weight: 700;
color: var(--accent);
margin: 0.5rem 0;
}
.button {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 0.5rem;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s, transform 0.1s;
}
.button-primary {
background-color: var(--button-bg);
color: white;
}
.button-primary:hover {
background-color: var(--button-hover);
transform: scale(1.02);
}
.button-primary:active {
transform: scale(0.98);
}
.button-success {
background-color: var(--success);
color: white;
}
.button-success:hover {
background-color: #059669;
}
.cart-summary {
background-color: #fef3c7;
border-color: var(--warning);
}
.cart-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.cart-count {
font-weight: 600;
color: var(--text);
}
.cart-total {
font-size: 1.5rem;
font-weight: 700;
color: var(--accent);
}
.search-bar {
width: 100%;
max-width: 400px;
}
.search-input {
width: 100%;
padding: 0.75rem;
border: 1px solid var(--border);
border-radius: 0.5rem;
font-size: 1rem;
transition: border-color 0.2s;
}
.search-input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.add-product-form {
display: flex;
flex-direction: column;
gap: 1rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.form-label {
font-weight: 600;
color: var(--text);
}
.form-input,
.form-select,
.form-textarea {
padding: 0.75rem;
border: 1px solid var(--border);
border-radius: 0.5rem;
font-size: 1rem;
font-family: inherit;
transition: border-color 0.2s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-textarea {
min-height: 80px;
resize: vertical;
}
.toggle-button {
background-color: rgba(255, 255, 255, 0.2);
color: white;
border: 1px solid rgba(255, 255, 255, 0.3);
padding: 0.5rem 1rem;
border-radius: 0.5rem;
cursor: pointer;
font-size: 0.9rem;
transition: background-color 0.2s;
}
.toggle-button:hover {
background-color: rgba(255, 255, 255, 0.3);
}
.price-original {
text-decoration: line-through;
color: var(--muted);
font-size: 1.1rem;
margin-right: 0.5rem;
}
.price-discount {
color: var(--success);
}
@media (max-width: 768px) {
.layout {
padding: 1rem;
}
.products-grid {
grid-template-columns: 1fr;
}
.banner {
flex-direction: column;
align-items: flex-start;
}
}