Every block
should be in separated file named as block.
Filename: rating-star.scss
.rating-star {
$font-size: 0.5em;
display: inline-block; // `display` style may be set freely
export type Route = { | |
method: "*" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "CONNECT" | "TRACE" | |
path: string | |
regexp: RegExp | |
handler: (request: Request, route: MatchedRoute) => Promise<Response> | |
} | |
export type MatchedRoute = Route & { | |
url: URL | |
} |
#!/usr/bin/env node | |
// TODO(vojta): pre-commit hook for validating messages | |
// TODO(vojta): report errors, currently Q silence everything which really sucks | |
'use strict'; | |
var child = require('child_process'); | |
var fs = require('fs'); | |
var util = require('util'); |
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) => { |
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), | |
) |
// 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. |
.collapse { | |
width: 100%; | |
margin: 1rem 0; | |
border: 1px solid var(--x33); | |
border-radius: 0.25rem; | |
background: #fff; | |
background-color: var(--x22); | |
&__header { |
@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), |
@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( | |
( |
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 |