Skip to content

Commit

Permalink
refactor: css base utils
Browse files Browse the repository at this point in the history
  • Loading branch information
dev129876 committed Nov 27, 2022
1 parent ca298b5 commit 5cbdee1
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/v1/components/home/header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Header = () => {
<img src={ChevronRight} aria-hidden={true} alt=""></img>
</a>
<h1>
The <span className={styles["highlight"]}>Free</span> Community for
The <span className={`animated-gradient`}>Free</span> Community for
Modern Learning.
</h1>
<p className={styles["tag-line"]}>
Expand Down
21 changes: 0 additions & 21 deletions src/v1/components/home/header/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,6 @@
margin: 1.5rem 0;
}

@keyframes background-pan {
from {
background-position: 0% center;
}

to {
background-position: -200% center;
}
}

.header-container h1 .highlight {
animation: background-pan 3s linear infinite;
background: linear-gradient(to right, var(--clr-primary), var(--clr-pink), var(--clr-yellow), var(--clr-primary));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
white-space: nowrap;
background-size: 200%;
height: 1.5em;
}

.header-container .tag-line {
font-style: normal;
font-weight: 450;
Expand Down
62 changes: 62 additions & 0 deletions src/v1/css/base/resets.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
*,
*::before,
*::after {
box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
h5,
h5,
p {
margin: 0;
}

html {
scroll-behavior: smooth;
font-size: 100%;
}

body {
min-height: 100vh;
font-family: var(--ff-primary);
}

img,
video,
iframe {
max-inline-size: 100%;
block-size: auto;
}

input,
button,
textarea,
select,
a {
font: inherit;
}

a {
text-decoration: none;
color: inherit;
}

/* Remove all animations, for users who have turned them off */
@media (prefers-reduced-motion: reduce) {
html:focus-within {
scroll-behavior: auto;
}

*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
10 changes: 10 additions & 0 deletions src/v1/css/base/root.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:root {
--clr-dark: #181E25;
--clr-primary: #a918a0;
--clr-secondary: #5F7086;
--clr-gray-light: #DEE4ED;
--clr-pink: rgba(207, 93, 113, 1);
--clr-yellow: rgba(255, 208, 129, 1);

--ff-primary: 'General Sans';
}
20 changes: 20 additions & 0 deletions src/v1/css/utlities/gradient.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@keyframes background-pan {
from {
background-position: 0% center;
}

to {
background-position: -200% center;
}
}

.animated-gradient {
animation: background-pan 3s linear infinite;
background: linear-gradient(to right, var(--clr-primary), var(--clr-pink), var(--clr-yellow), var(--clr-primary));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
white-space: nowrap;
background-size: 200%;
height: 1.5em;
}
4 changes: 4 additions & 0 deletions src/v1/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import url("./css/base/root.css");
@import url("./css/base/resets.css");

@import url("./css/utlities/gradient.css");

0 comments on commit 5cbdee1

Please sign in to comment.