Skip to content

Commit 3c92a83

Browse files
committed
Add basic transitions (to buttons etc)
1 parent 063ffde commit 3c92a83

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

components/Molecules/BackToTopBtn/BackToTopBtn.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const useStyles = createStyles((theme, _params) => ({
1515
alignContent: "center",
1616
alignItems: "center",
1717
cursor: "pointer",
18+
transitionProperty: "all !important",
19+
1820
"&:hover": {
1921
color: theme.colors.dark[1],
2022
borderColor: theme.colors.dark[1],

components/Molecules/ProjectCard/ProjectCard.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const useStyles = createStyles((theme) => ({
2323
cursor: "pointer",
2424
},
2525
padding: theme.spacing.md,
26+
transition: ".35s ease",
27+
2628
[theme.fn.smallerThan("sm")]: {
2729
padding: theme.spacing.sm,
2830
},

components/Organisms/Header/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const useStyles = createStyles((theme) => ({
4444
color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.colors.gray[7],
4545
fontSize: theme.fontSizes.sm,
4646
fontWeight: 500,
47+
transition: "var(--btn-transition)",
4748

4849
"&:hover": {
4950
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0],

pages/_app.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ import "../styles/globals.css";
22
import Head from "next/head";
33
import { useEffect, useState } from "react";
44
import { AppProps } from "next/app";
5-
import { ColorScheme, ColorSchemeProvider, MantineProvider } from "@mantine/core";
5+
import {
6+
ButtonStylesParams,
7+
ColorScheme,
8+
ColorSchemeProvider,
9+
CSSObject,
10+
MantineProvider,
11+
MantineTheme,
12+
MantineThemeOverride,
13+
} from "@mantine/core";
614
import BackToTopBtn from "../components/Molecules/BackToTopBtn/BackToTopBtn";
715
import Header from "../components/Organisms/Header/Header";
816
import Footer from "../components/Organisms/Footer/Footer";
@@ -38,6 +46,18 @@ function App({ Component, pageProps }: AppProps) {
3846
},
3947
];
4048

49+
const globalTheme: MantineThemeOverride = {
50+
colorScheme: colorScheme,
51+
components: {
52+
Button: {
53+
styles: { root: { transition: "var(--btn-transition)" } },
54+
},
55+
ActionIcon: {
56+
styles: { root: { transition: "var(--btn-transition)" } },
57+
},
58+
},
59+
};
60+
4161
return (
4262
<>
4363
<Head>
@@ -53,7 +73,7 @@ function App({ Component, pageProps }: AppProps) {
5373
</Head>
5474

5575
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={toggleColorScheme}>
56-
<MantineProvider withGlobalStyles withNormalizeCSS theme={{ colorScheme }} emotionCache={emotionCache}>
76+
<MantineProvider withGlobalStyles withNormalizeCSS theme={globalTheme} emotionCache={emotionCache}>
5777
<Header links={links} />
5878
<Component {...pageProps} />
5979
<Footer />

styles/globals.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,17 @@ a {
3434

3535
.hidden {
3636
visibility: hidden;
37-
/* opacity: 0.1; */
3837
}
3938

39+
/* ===============================
40+
* CSS Variables
41+
* =============================== */
42+
43+
:root {
44+
--btn-transition: .35s ease
45+
}
46+
47+
4048
/* ===============================
4149
* Global Animations
4250
* =============================== */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy