This file contains hidden or 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 express from 'express' | |
import compression from 'compression' | |
import { renderPage } from 'vite-plugin-ssr' | |
import { Options } from 'sirv' | |
import fs from 'fs' | |
import path from 'path' | |
import https from 'https' | |
const isProduction = process.env.NODE_ENV === 'production' | |
const root = `${__dirname}/..` |
This file contains hidden or 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
.first { | |
color: green; | |
} | |
%example-default { | |
color: red; | |
} | |
.bdg { | |
@extend %example-default; |
This file contains hidden or 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 * as React from "react"; | |
const displayItem = (currentPage: number, maxPerPage: number, index:number): boolean => { | |
const currentPageStart = ((currentPage - 1) * maxPerPage) + 1; | |
const currentPageEnd = currentPage * maxPerPage; | |
if ((index + 1) >= currentPageStart && (index + 1) <= currentPageEnd ) { | |
return true; | |
} |
This file contains hidden or 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 fs from 'node:fs/promises' | |
import path from 'node:path' | |
import { exec } from 'node:child_process' | |
import { promisify } from 'node:util' | |
export const execAsync = promisify(exec) | |
export interface PackageJson { | |
name: string |
This file contains hidden or 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:map'; | |
@use 'sass:math'; | |
$font-size-base: 1rem !default; | |
$font-size-min: 0.875rem !default; | |
$font-size-max: 1.125rem !default; | |
$font-ratios: () !default; | |
$font-ratios: map.merge( | |
( |
This file contains hidden or 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:map'; | |
$colors: () !default; | |
$colors: map.merge( | |
( | |
'light': ( | |
'color-bg': hsl(0deg 0 100), | |
'color-surface': hsl(0deg 0 90), | |
'color-text': hsl(0deg 0 0), | |
'color-text-2': hsl(0deg 0 10), |
This file contains hidden or 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
.collapse { | |
width: 100%; | |
margin: 1rem 0; | |
border: 1px solid var(--x33); | |
border-radius: 0.25rem; | |
background: #fff; | |
background-color: var(--x22); | |
&__header { |
This file contains hidden or 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
// The basis of calculations, and your root html font size. | |
$base-font-size: 16px | |
// Change this to your type scale modifier. | |
// https://type-scale.com/ | |
$type-scale: 1.25 | |
// The desired unit supports "rem", "em", and "%". | |
$desired-unit: 'rem' | |
// Generate a type scale value based on the number of steps if this is ascending or descending. | |
// It is recommended to compile with the "--precision 3" flag to avoid long decimals. |
This file contains hidden or 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 { useState, useLayoutEffect } from 'react' | |
type FullScreenState = boolean | |
type ToggleFullScreen = () => void | |
function useFullScreen<E extends HTMLElement>(ref: React.RefObject<E>): [FullScreenState, ToggleFullScreen] { | |
const [isFullScreen, setFullScreen] = useState( | |
Boolean(document.fullscreenElement), | |
) |
This file contains hidden or 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 * as React from 'react'; | |
export const getNodeArray = <Props = any>( | |
components: React.ReactNode, | |
filter?: string | React.ComponentClass<any> | React.SFC<any>, | |
) => { | |
let result = React.Children.toArray(components).map(React.Children.only) as React.ReactElement<Props>[]; | |
if (filter) { | |
result = result.filter((c) => { |