Skip to content

Instantly share code, notes, and snippets.

@evdama
evdama / ThemeToggle.svelte
Created May 8, 2020 08:08
using this theme toggle inside _layout.svelte
<script>
let html, currentColorScheme = 'light'
if (process.browser) {
html = document.getElementsByTagName('html')[0]
window.matchMedia('(prefers-color-scheme: dark)').addListener(({ matches }) => {
if (matches) {
html.dataset.theme = 'dark'
currentColorScheme = 'dark'
@evdama
evdama / rollup.config.js
Created April 25, 2020 05:55
rollup-plugin-postcss v3.1.1 broke this build again
// @ts-nocheck //TODO: enable remove once there are typings in place
// TODO: uncomment all three eslint() occurrences once eslint warnings and errors are fixed
// for info on emitCSS etc. https://github.com/rollup/rollup-plugin-svelte#extracting-css and https://svelte.dev/docs#svelte_preprocess
// import { eslint } from 'rollup-plugin-eslint'
import { terser } from 'rollup-plugin-terser'
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import config from 'sapper/config/rollup.js'
import environmentVariables from './config/env'
const colors = {
transparent: 'transparent',
black: '#000000',
white: '#FFFFFF',
'red-50': '#FFEBEE',
'red-100': '#FFCDD2',
'red-200': '#EF9A9A',
'red-300': '#E57373',
'red-400': '#EF5350',
@import "tailwindcss/base";
@import "tailwindcss/components";
@import './components';
@import "tailwindcss/utilities";
@import './edm-utilities';
:root {
--font-family-one: Inter, sans-serif;
--font-weight-black: 900;
--font-weight-bold: 700;
@evdama
evdama / Nav.svelte
Last active April 11, 2020 17:07
tailwind UI navbar from alpine to svelte... example
<script>
import { authState } from 'rxfire/auth'
import { fade, fly } from 'svelte/transition'
import { onMount } from 'svelte'
import { tuiClassToggle } from 'utils'
import { writable } from 'svelte/store'
import ClickOutside from 'svelte-click-outside'
import EDMDropDown from './EDMDropDown.svelte'
import UserDropDown from './UserDropDown.svelte'
@evdama
evdama / rollup.config.js
Created July 4, 2019 02:33
rollup.config.js for sapper, tailwind and firebase
// @ts-nocheck TODO: remove at some point
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import config from 'sapper/config/rollup.js';
import getPreprocessor from 'svelte-preprocess'
import path from 'path'
import pkg from './package.json';
import postcss from 'rollup-plugin-postcss'
import replace from 'rollup-plugin-replace';
@evdama
evdama / rollup.config.js
Created January 21, 2020 08:29
postcss-purgecss 2.0.5 throwing error
// @ts-nocheck //TODO: enable remove once there are typings in place
// TODO: uncomment all three eslint() occurrences once eslint warnings and errors are fixed
// for info on emitCSS etc. https://github.com/rollup/rollup-plugin-svelte#extracting-css and https://svelte.dev/docs#svelte_preprocess
import { eslint } from 'rollup-plugin-eslint'
import { terser } from 'rollup-plugin-terser'
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import config from 'sapper/config/rollup.js'
import environmentVariables from './config/env'
@evdama
evdama / tailwind.config.js
Last active January 10, 2020 12:21
extended rotate and scale for v1.2.0-canary.5
const colors = {
'transparent': 'transparent',
'black': '#000000',
'white': '#FFFFFF',
'red-50': '#FFEBEE',
'red-100': '#FFCDD2',
'red-200': '#EF9A9A',
'red-300': '#E57373',
'red-400': '#EF5350',
// @ts-nocheck //TODO: enable remove once there are typings in place
// TODO: uncomment all three eslint() occurrences once eslint warnings and errors are fixed
// for info on emitCSS etc. https://github.com/rollup/rollup-plugin-svelte#extracting-css and https://svelte.dev/docs#svelte_preprocess
import { eslint } from 'rollup-plugin-eslint'
import { terser } from 'rollup-plugin-terser'
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import config from 'sapper/config/rollup.js'
import environmentVariables from './config/env'
{
"dependencies": {
"axios": "^0.19.0",
"compression": "^1.7.4",
"express": "^4.17.1",
"express-useragent": "^1.0.13",
"sirv": "^0.4.2"
},
"description": "This is the source code repository for Everyday Market.",
"devDependencies": {