-
When writing a string of multiple utility classes, always do so in an order with meaning. The "Concentric CSS" approach works well with utility classes (i.e,. 1. positioning/visibility 2. box model 3. borders 4. backgrounds 5. typography 6. other visual adjustments). Once you establish a familiar pattern of ordering, parsing through long strings of utility classes will become much, much faster so a little more effort up front goes a long way!
-
Always use fewer utility classes when possible. For example, use
mx-2instead ofml-2 mr-2and don't be afraid to use the simplerp-4 lg:pt-8instead of the longer, more complicatedpt-4 lg:pt-8 pr-4 pb-4 pl-4. -
Prefix all utility classes that will only apply at a certain breakpoint with that breakpoint's prefix. For example, use
block lg:flex lg:flex-col lg:justify-centerinstead ofblock lg:flex flex-col justify-centerto make it very clear that the flexbox utilities are only applicable at the
| # Build stage | |
| FROM nvidia/opengl:1.0-glvnd-devel-ubuntu20.04 as builder | |
| # Install node 14.0 | |
| RUN apt-get update -y && \ | |
| apt-get install -y curl gnupg ca-certificates && \ | |
| curl -sL https://deb.nodesource.com/setup_14.x | bash - && \ | |
| apt-get install -y nodejs | |
| # See: https://github.com/stackgl/headless-gl#ubuntudebian |
| import * as React from 'react' | |
| // routing, etc. | |
| import { Reset } from '~/ui/shared/Reset' | |
| export class App extends React.Component { | |
| public render() { | |
| return ( | |
| <div> | |
| <title>Dashboard</title> |
| const path = require("path"); | |
| const withTypescript = require("@zeit/next-typescript"); | |
| const withCSS = require("@zeit/next-css"); | |
| const withSourceMaps = require("@zeit/next-source-maps"); | |
| const r = require("regexr"); | |
| const cssConfig = { | |
| cssModules: false | |
| }; |
| { | |
| "presets": ["@babel/preset-typescript", "next/babel"], | |
| } | |
| /* tslint:disable */ | |
| const withCss = require("@zeit/next-css"); | |
| const withSass = require("@zeit/next-sass"); | |
| const withTypescript = require("@zeit/next-typescript"); | |
| const withSourceMaps = require("@zeit/next-source-maps"); |
zeit/pkg needs to know which assets to include for TypeScript (tsconfig.json) and be able to resolve any dynamic requires.
This package.json shows how to configure zeit/pkg with gluegun.
In this example, the assets key is used for pkg to copy necessary files into the built binary
and resolve the dynamic requires to find extensions and commands. TypeScript requires some basic
type definitions (*.d.ts files) to compile and run which are included with the TypeScript compiler.
| // | |
| // Config.swift | |
| // Analytics | |
| // | |
| public protocol AnalyticsConfig { | |
| static var analyticsKey: String { get } | |
| static var appVersion: String { get } | |
| } |
| var Nightmare = require('nightmare'), | |
| path = require('path'), // ADD THIS | |
| nightmare = Nightmare({ | |
| show: true, | |
| alwaysOnTop: false, | |
| webPreferences: { | |
| preload: path.resolve('preload.js') // USE PATH.RESOLVE FUNCTION | |
| } | |
| }); |
babel-plugin-add-module-exports generates an incorrect bundle if you use ES modules in the latest versions of Webpack 2 (at least in 2.1.0-beta.27 and .28). Here’s what to do.
{
"plugins": [
- "add-module-exports"
]
}Based on the following guide: https://ericdraken.com/running-xvfb-on-a-shared-host-without-x/
Using the following docker image: https://hub.docker.com/r/lambci/lambda/