Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS global variables added to global.css #9

Merged
merged 5 commits into from
Nov 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 181 additions & 0 deletions src/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
/* GLOBAL STYLES */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html {
font-size: 100%;
} /*16px*/

:root {
/* main colors */
--color-green-dark: #519872;
--color-green-med: #a4b494;
--color-green-lightest: #bec5ad;
--color-blue-dark: #28535c;
--color-blue-light: #356a82;

/* greys */
--grey-50: #f8fafc;
--grey-100: #f1f5f9;
--grey-200: #e2e8f0;
--grey-300: #cbd5e1;
--grey-400: #94a3b8;
--grey-500: #64748b;
--grey-600: #475569;
--grey-700: #334155;
--grey-800: #1e293b;
--grey-900: #0f172a;
/* rest of the colors */
--black: #222;
--white: #fff;
/* DEFAULTS */
--background-color: #e2e8f0;
--text-color: #222;

/* OTHERS */
--border-radius: 0.25rem;
--letter-spacing: 1px;
--transition: 0.3s ease-in-out all;
--max-width: 1120px;
--fixed-width: 600px;
--fluid-width: 90vw;
/* box shadow*/
--shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
--shadow-2: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
--shadow-3: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
0 4px 6px -2px rgba(0, 0, 0, 0.05);
--shadow-4: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
background: var(--background-color);
color: var(--text-color);
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
line-height: 1;
}

h1,
h2,
h3,
h4,
h5 {
margin: 0;
font-weight: 400;
line-height: 1;
letter-spacing: var(--letter-spacing);
}

h1 {
font-size: clamp(2rem, 5vw, 5rem); /* Large heading */
}

h2 {
font-size: clamp(1.5rem, 3vw, 3rem); /* Medium heading */
}

h3 {
font-size: clamp(1.25rem, 2.5vw, 2.5rem); /* Small heading */
}

h4 {
font-size: clamp(1rem, 2vw, 2rem); /* Extra small heading */
}

h5 {
font-size: clamp(0.875rem, 1.5vw, 1.5rem); /* Tiny heading */
}

a {
text-decoration: none;
}
ul {
list-style-type: none;
padding: 0;
}

.img {
width: 100%;
display: block;
object-fit: cover;
}

/* BUTTONS */
.btn {
cursor: pointer;
color: var(--white);
background: var(--grey-600);
border: transparent;
border-radius: var(--border-radius);
letter-spacing: var(--letter-spacing);
padding: 0.375rem 0.75rem;
box-shadow: var(--shadow-1);
transition: var(--transition);
text-transform: capitalize;
display: inline-block;
}
.btn:hover {
background: var(--grey-600);
box-shadow: var(--shadow-3);
}

.btn-block {
width: 100%;
}

/* FORMS */

.form {
width: 90vw;
max-width: var(--fixed-width);
border-radius: var(--border-radius);
box-shadow: var(--shadow-2);
padding: 2rem 2.5rem;
margin: 3rem auto;
}
.form-label {
display: block;
font-size: var(--small-text);
margin-bottom: 0.75rem;
text-transform: capitalize;
letter-spacing: var(--letter-spacing);
line-height: 1.5;
}
.form-input,
.form-textarea,
.form-select {
width: 100%;
padding: 0.375rem 0.75rem;
border-radius: var(--border-radius);
background: var(--grey-600);
border: 1px solid var(--grey-300);
color: var(--text-color);
}
.form-input,
.form-select,
.form-btn {
height: 35px;
}
.form-row {
margin-bottom: 1rem;
}

.form-textarea {
height: 7rem;
}

.title {
text-align: center;
}

.container {
width: var(--fluid-width);
max-width: var(--max-width);
margin: 0 auto;
}