- Create a
~/Sites
folder if you don’t already have one - Enable PHP by uncommenting the
php5_module
line in/etc/apache2/httpd.conf
- Find the line that read
User _www
and change the_www
to your username (whoami) - Find the
DirectoryIndex
line and change it toDirectoryIndex index.php index.html index.htm
- Change the
DocumentRoot
line toDocumentRoot "/Users/yourusername/Sites/"
- Change the
<Directory
line to<Directory "/Users/yourusername/Sites/">
- Run
sudo apachectl restart
- Restart your computer (yes, this is necessary)
/** | |
* Filter out hard-coded width, height attributes on all images in WordPress. | |
* https://gist.github.com/4557917 | |
* | |
* This version applies the function as a filter to the_content rather than send_to_editor. | |
* Changes made by filtering send_to_editor will be lost if you update the image or associated post | |
* and you will slowly lose your grip on sanity if you don't know to keep an eye out for it. | |
* the_content applies to the content of a post after it is retrieved from the database and is "theme-safe". | |
* (i.e., Your changes will not be stored permanently or impact the HTML output in other themes.) | |
* |
#!/bin/bash | |
PROGNAME=${0##*/} | |
INPUT='' | |
QUIET='0' | |
NOSTATS='0' | |
max_input_size=0 | |
max_output_size=0 | |
usage() |
var options, paths, | |
gulp = require("gulp"), | |
merge = require("merge-stream"), | |
path = require("path"), | |
clean = require("gulp-clean"), | |
concat = require("gulp-concat"), | |
markdown = require("gulp-markdown"), | |
minifyCSS = require("gulp-minify-css"), | |
removeLines = require("gulp-remove-lines"), |
____________________________________________________________________________ | |
/ Care at the Beginning \ | |
| | | |
| What lies still is easy to grasp; What lies far off is easy to anticipate; | | |
| What is brittle is easy to shatter; What is small is easy to disperse. Yet | | |
| a tree broader than a man can embrace is born of a tiny shoot; A dam | | |
| greater than a river can overflow starts with a clod of earth; A journey | | |
| of a thousand miles begins at the spot under one's feet. Therefore deal | | |
| with things before they happen; Create order before there is confusion. | | |
| | |
First of all you need to decide who will be your target consumers based on the following:
-
They have the same environment(webpack config, babel config) setup as you where you built your design system(this is mostly possible if you use monorepos/same configs where all the teams share the same environment).
-
They don't have the same environment which is the case when you work in bigger teams and you want to distribute your design system as any other npm package which is already built and can be used directly.
If your use case falls under case no. 1 then you can just compile the source babel src -d build
and leave the bundling to the consumer projects tools(webpack/rollup)
This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root
element.
There are a couple of main reasons this is helpful:
- You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
- You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.
See the Tailwind Plugins for more info on plugins.
import React from "react"; | |
export type ColorScheme = "light" | "dark"; | |
export default function useColorSchemePreference( | |
defaultColorScheme: ColorScheme = "light" | |
) { | |
let darkQuery = "(prefers-color-scheme: dark)"; | |
let [colorScheme, setColorScheme] = React.useState<ColorScheme>( | |
typeof window === "object" && window.matchMedia |
name: Lint and autofix | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: |