Skip to content

Commit

Permalink
add darkmode-react-component
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasferreiralimax committed Jun 30, 2024
1 parent 7d6a728 commit 138de87
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 29 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"preview": "vite preview"
},
"dependencies": {
"darkmode-react-component": "^0.1.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-techs-logos": "^0.1.9"
Expand Down
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import reactLogo from "./assets/techs/react.svg";
import "./App.css";
import pkg from "../package.json";

import DarkModeReact from 'darkmode-react-component';
import ReactTechsLogos from "./components/ReactTechsLogos";
// import ReactTechsLogos from 'react-techs-logos'

Expand All @@ -19,6 +19,7 @@ function App() {
<img src={reactLogo} alt="React logo" />
<h1>react-techs-logos@{version}</h1>
</a>
<DarkModeReact />
</div>
<div className="content">
<h2>Install</h2>
Expand Down
2 changes: 2 additions & 0 deletions src/assets/techs/aws.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/assets/techs/pandas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 20 additions & 18 deletions src/components/ReactTechsLogos/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ figure {
}
}

body {
--vtl-background: rgba(0,0,0, .05);
--vtl-background-tooltip: #444;
--vtl-shadow-tooltip: rgba(0,0,0,.2);
--vtl-text: #000;
--vtl-background-svg: #000;
--vtl-background-svg-invert: #fff;
--vtl-background-gradient: linear-gradient(228deg, rgba(238,238,238,1) 0%, rgba(255,255,255,1) 60%);
}

body.darkmode {
--vtl-background: rgba(0,0,0, .5);
--vtl-background-tooltip: #444;
--vtl-shadow-tooltip: rgba(0,0,0,.2);
--vtl-text: #fff;
--vtl-background-svg: #fff;
--vtl-background-svg-invert: #000;
--vtl-background-gradient: linear-gradient(228deg, rgb(24, 24, 24) 0%, rgb(38, 38, 38) 60%);
}

@media (prefers-color-scheme: light) {
:root {
--vtl-background: rgba(0,0,0, .05);
Expand All @@ -66,15 +86,6 @@ figure {
--vtl-background-svg-invert: #fff;
--vtl-background-gradient: linear-gradient(228deg, rgba(238,238,238,1) 0%, rgba(255,255,255,1) 60%);
}
body {
--vtl-background: rgba(0,0,0, .05);
--vtl-background-tooltip: #444;
--vtl-shadow-tooltip: rgba(0,0,0,.2);
--vtl-text: #000;
--vtl-background-svg: #000;
--vtl-background-svg-invert: #fff;
--vtl-background-gradient: linear-gradient(228deg, rgba(238,238,238,1) 0%, rgba(255,255,255,1) 60%);
}
}

@media (prefers-color-scheme: dark) {
Expand All @@ -87,13 +98,4 @@ figure {
--vtl-background-svg-invert: #000;
--vtl-background-gradient: linear-gradient(228deg, rgb(24, 24, 24) 0%, rgb(38, 38, 38) 60%);
}
body.darkmode {
--vtl-background: rgba(0,0,0, .5);
--vtl-background-tooltip: #444;
--vtl-shadow-tooltip: rgba(0,0,0,.2);
--vtl-text: #fff;
--vtl-background-svg: #fff;
--vtl-background-svg-invert: #000;
--vtl-background-gradient: linear-gradient(228deg, rgb(24, 24, 24) 0%, rgb(38, 38, 38) 60%);
}
}
15 changes: 5 additions & 10 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
Expand All @@ -26,14 +24,11 @@ body {
place-items: center;
min-width: 320px;
min-height: 100vh;
color: #213547;
background-color: #ffffff;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
button {
background-color: #f9f9f9;
}
body.darkmode {
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
}
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="vite/client" />
/// <reference types="vite-plugin-svgr/client" />
declare module 'react-techs-logos';
declare module 'darkmode-react-component';

0 comments on commit 138de87

Please sign in to comment.