This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Colors } from "./colors"; | |
import styles from "./JSExports.module.scss"; | |
export const JSExports = () => { | |
return ( | |
<div> | |
<p> | |
Used scss and css and JS to access these colors, kinda complicated but | |
useful AF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import variables from "./JSExports.module.scss"; | |
export const Colors = variables; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import './variables'; | |
$primary-color: var(--primary-color); | |
$secondary-color: var(--secondary-color); | |
.boxes { | |
display: flex; | |
justify-content: space-around; | |
&__box { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$primary-color: #3498db; | |
$secondary-color: #e74c3c; | |
:export { | |
primaryColor: $primary-color; | |
secondaryColor: $secondary-color; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import '../../styles/helpers'; | |
.long-list { | |
overflow: auto; | |
display: flex; | |
@include no-scrollbar(); | |
&__item { | |
min-width: 150px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$colors: ( | |
primary: #4038FF, | |
secondary: #6C7689, | |
success: #0AAF60, | |
warning: #FFBE21, | |
error: #EA5B5B, | |
); | |
@mixin badge-color($bg-color) { | |
background-color: $bg-color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin no-scrollbar() { | |
-ms-overflow-style: none; | |
scrollbar-width: none; | |
box-sizing: border-box; | |
// Hide scrollbar for Chrome, Safari and Opera | |
&::-webkit-scrollbar { | |
display: none; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@use 'sass:color'; | |
@function hex-to-rgba($hex, $alpha: 1) { | |
$red: red($hex); | |
$green: green($hex); | |
$blue: blue($hex); | |
@return rgba($red, $green, $blue, $alpha); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const heavyFn = () => { | |
let total = 0 | |
for (let i = 0; i <= 10000000000; i++) { | |
total += i | |
} | |
return total | |
} | |
console.time('test-fn') | |
heavyFn() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const App = () => { | |
const handleRenderComponent = (id, phase, actualDuration, baseDuration, startTime, commitTime) => { | |
console.log(`Component ${id} took ${actualDuration} to render on ${phase}`); | |
} | |
return ( | |
<Profiler id="heavy" onRender={handleRenderComponent}> | |
<SomeHeavyComponent /> | |
</Profiler> |
NewerOlder