Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Commit

Permalink
Using theme name as target directory name, kebab-case
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Dern committed Oct 6, 2020
1 parent 70d211d commit a4c4bdd
Show file tree
Hide file tree
Showing 6 changed files with 145,681 additions and 27 deletions.
6 changes: 3 additions & 3 deletions config/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ current:
label: ''
major: 0
minor: 3
patch: 19
prerelease: 2-gdf1c028
patch: 20
prerelease: 1-g70d211d
buildmetadata: ''
commit: df1c02
commit: 70d211
timestamp:
year: 2020
month: 10
Expand Down
49,627 changes: 49,625 additions & 2 deletions public/js/app.js

Large diffs are not rendered by default.

48,017 changes: 48,015 additions & 2 deletions public/js/import.js

Large diffs are not rendered by default.

48,017 changes: 48,015 additions & 2 deletions public/js/themes-browser.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"/js/app.js": "/js/app.js?id=18db4790b2e3589932b7",
"/themes/cyca_theme_dark/theme.css": "/themes/cyca_theme_dark/theme.css?id=7e6c4399b9945e67cd59",
"/themes/cyca_theme_light/theme.css": "/themes/cyca_theme_light/theme.css?id=d41551553fd327732765",
"/js/import.js": "/js/import.js?id=fe140d06e21a2f3ef681",
"/js/themes-browser.js": "/js/themes-browser.js?id=8ab8ff893a01713a6a07",
"/themes/cyca_theme_dark/theme.json": "/themes/cyca_theme_dark/theme.json?id=e6af9f523b70bc467aa4",
"/themes/cyca_theme_light/theme.json": "/themes/cyca_theme_light/theme.json?id=e55338493fb0f35db50c"
"/js/app.js": "/js/app.js",
"/themes/cyca-dark/theme.css": "/themes/cyca-dark/theme.css",
"/themes/cyca-light/theme.css": "/themes/cyca-light/theme.css",
"/js/import.js": "/js/import.js",
"/js/themes-browser.js": "/js/themes-browser.js",
"/themes/cyca-dark/theme.json": "/themes/cyca-dark/theme.json",
"/themes/cyca-light/theme.json": "/themes/cyca-light/theme.json"
}
27 changes: 16 additions & 11 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@ const themes = fs.readdirSync(themesDir);

themes.forEach(theme => {
const themeDir = themesDir + "/" + theme;
const publicThemeDir = publicDir + "/" + theme;

if (fs.lstatSync(themeDir).isDirectory()) {
mix.postCss(
themeDir + "/theme.css",
publicThemeDir + "/theme.css",
[
require("postcss-import"),
require("tailwindcss")(themeDir + "/theme.js"),
require("postcss-nested"),
require("autoprefixer")
]
);
const json = require("./" + themeDir + "/theme.json");
const themeName = json["name"]
.match(
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
)
.map(x => x.toLowerCase())
.join("-");

const publicThemeDir = publicDir + "/" + themeName;

mix.postCss(themeDir + "/theme.css", publicThemeDir + "/theme.css", [
require("postcss-import"),
require("tailwindcss")(themeDir + "/theme.js"),
require("postcss-nested"),
require("autoprefixer")
]);

mix.copy(themeDir + "/theme.json", publicThemeDir + "/");
mix.copy(themeDir + "/resources/", publicThemeDir + "/");
Expand Down

0 comments on commit a4c4bdd

Please sign in to comment.