Compare commits
6 Commits
master
...
templatize
Author | SHA1 | Date |
---|---|---|
Vivian Lim | 319ecbc80c | |
Vivian Lim | bddee4c921 | |
Vivian Lim | 89c5df10ad | |
Vivian Lim | 15fa0960c5 | |
Vivian Lim | d58b0b9613 | |
Vivian Lim | a84c6ea8bc |
|
@ -0,0 +1,2 @@
|
|||
node_modules/
|
||||
css/
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
import re
|
||||
|
||||
num_lines = 230
|
||||
scss = open("theme_base/css/index.scss").readlines()
|
||||
|
||||
reused_colors = {}
|
||||
|
||||
for line_num in list(range(0, num_lines)):
|
||||
match = re.search(r'\$([a-z,\-]+): ([0-9,a-f,A-F,#]+)', scss[line_num])
|
||||
if match is None:
|
||||
continue
|
||||
name, value = match.groups()
|
||||
if value in reused_colors:
|
||||
reused_colors[value] += [name]
|
||||
else:
|
||||
reused_colors[value] = [name]
|
||||
|
||||
|
||||
print(reused_colors)
|
||||
|
||||
out = open('out_theme.scss', 'w')
|
||||
|
||||
index = 1
|
||||
for value, names in reused_colors.items():
|
||||
if len(names) > 1: # duplicates! bunch em up
|
||||
new_var_name = f'$unnamed-{index}'
|
||||
out.write(f'{new_var_name}: {value};\n')
|
||||
for n in names:
|
||||
out.write(f'${n}: {new_var_name};\n')
|
||||
index += 1
|
||||
else:
|
||||
out.write(f'${names[0]}: {value};\n')
|
||||
out.write('\n')
|
|
@ -0,0 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
var gulp = require('gulp');
|
||||
var sass = require('gulp-sass');
|
||||
|
||||
sass.compiler = require('node-sass');
|
||||
|
||||
gulp.task('sass', function () {
|
||||
return gulp.src('./*.scss')
|
||||
.pipe(sass().on('error', sass.logError))
|
||||
.pipe(gulp.dest('./css'));
|
||||
});
|
||||
|
||||
gulp.task('sass:watch', function () {
|
||||
gulp.watch('./sass/**/*.scss', ['sass']);
|
||||
});
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "smf-curve-dynamic",
|
||||
"version": "0.0.1",
|
||||
"description": "Dynamic-ish modern-ish theme for SMF forums.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://vvn.space/git/vivlim/smf-curve-dynamic.git"
|
||||
},
|
||||
"author": "Viv",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-sass": "^4.0.2",
|
||||
"sass": "^1.17.4"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
$body-background-top: #00FF00;
|
||||
$body-background-bottom: #FF00FF;
|
||||
@import 'theme_base/css/index.scss'
|
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 118 B |
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 118 B |
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 121 B |
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 118 B |
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 124 B |
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 499 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 87 B After Width: | Height: | Size: 87 B |
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 128 B |
Before Width: | Height: | Size: 98 B After Width: | Height: | Size: 98 B |
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 128 B |
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 124 B |
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
Before Width: | Height: | Size: 122 B After Width: | Height: | Size: 122 B |
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 124 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
Before Width: | Height: | Size: 595 B After Width: | Height: | Size: 595 B |
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 128 B |
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 117 B After Width: | Height: | Size: 117 B |
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 118 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 60 B After Width: | Height: | Size: 60 B |
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 128 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 734 B |
Before Width: | Height: | Size: 799 B After Width: | Height: | Size: 799 B |
Before Width: | Height: | Size: 811 B After Width: | Height: | Size: 811 B |
Before Width: | Height: | Size: 85 B After Width: | Height: | Size: 85 B |
Before Width: | Height: | Size: 72 B After Width: | Height: | Size: 72 B |
Before Width: | Height: | Size: 87 B After Width: | Height: | Size: 87 B |
Before Width: | Height: | Size: 56 B After Width: | Height: | Size: 56 B |
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 82 B After Width: | Height: | Size: 82 B |
Before Width: | Height: | Size: 573 B After Width: | Height: | Size: 573 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 73 B After Width: | Height: | Size: 73 B |
Before Width: | Height: | Size: 85 B After Width: | Height: | Size: 85 B |
Before Width: | Height: | Size: 785 B After Width: | Height: | Size: 785 B |
Before Width: | Height: | Size: 89 B After Width: | Height: | Size: 89 B |
Before Width: | Height: | Size: 73 B After Width: | Height: | Size: 73 B |
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 827 B |
Before Width: | Height: | Size: 73 B After Width: | Height: | Size: 73 B |
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 81 B After Width: | Height: | Size: 81 B |
Before Width: | Height: | Size: 83 B After Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 335 B |