From 692bfa8660ba69df1c1967383fc95e229201cd17 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 20 Jan 2018 12:35:38 -0800 Subject: [PATCH] more semantic class names, option to globalize CSS --- bin/globalize-css.js | 46 +++++++++++++++++++ package.json | 5 +- routes/_components/LoadingSpinner.html | 6 +-- routes/_components/Nav.html | 8 ++-- routes/_components/NavItem.html | 22 ++++----- routes/_components/NotLoggedInHome.html | 8 ++-- routes/_components/VirtualListItem.html | 2 +- routes/settings/_components/SettingsList.html | 6 +-- .../_components/SettingsListItem.html | 16 +++---- routes/settings/_components/SettingsNav.html | 10 ++-- .../settings/_components/SettingsNavItem.html | 6 +-- routes/settings/instances/add.html | 6 +-- 12 files changed, 95 insertions(+), 46 deletions(-) create mode 100755 bin/globalize-css.js diff --git a/bin/globalize-css.js b/bin/globalize-css.js new file mode 100755 index 0000000..e721848 --- /dev/null +++ b/bin/globalize-css.js @@ -0,0 +1,46 @@ +#!/usr/bin/env node +// Change all the Svelte CSS to just use globals everywhere, +// to reduce CSS size and complexity. + +const argv = require('yargs').argv +const path = require('path') +const fs = require('fs') +const pify = require('pify') +const writeFile = pify(fs.writeFile.bind(fs)) +const readFile = pify(fs.readFile.bind(fs)) +const glob = pify(require('glob')) +const rimraf = pify(require('rimraf')) + +const selectorRegex = /\n[ \t]*([0-9\w\- \t\.:#,]+?)[ \t]*\{/g +const styleRegex = / diff --git a/routes/settings/instances/add.html b/routes/settings/instances/add.html index 2bebdd9..676c229 100644 --- a/routes/settings/instances/add.html +++ b/routes/settings/instances/add.html @@ -16,7 +16,7 @@
- +
@@ -27,12 +27,12 @@