Skip to content

Commit

Permalink
release 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
khang-nd committed Oct 19, 2022
1 parent 6a3e0a6 commit bad8cac
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node_modules/
gui/
docs/
*.js
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.8.0

* Added separate CSS for each GUI component.
* Added glow effect to title bar buttons & tweaked window shadow.

## 0.7.0

* Added button's `default` variant.
Expand Down
35 changes: 35 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,40 @@ async function buildCSS(usePrefix) {
fs.writeFileSync(targetFile + ".map", result.map.toString());
}

function buildComponents() {
fs.readdir("gui", async (err, files) => {
const targetFolder = "dist/gui";
const variablesFile = "_variables.scss";

const fileResults = files
.filter((file) => file.startsWith("_") && file !== variablesFile)
.map((file) => ({
name: file.slice(1),
content:
fs.readFileSync("gui/" + variablesFile) +
fs.readFileSync("gui/" + file),
}));

const parsedResults = fileResults.map(async (file) => {
const target = targetFolder + "/" + file.name.replace("scss", "css");
return {
target,
parsed: await parser.process(file.content, {
from: "gui/" + file.name,
to: target,
map: { inline: false },
}),
};
});

mkdirp.sync(targetFolder);
const results = await Promise.all(parsedResults);
results.forEach((result) =>
fs.writeFile(result.target, result.parsed.css, () => {})
);
});
}

function buildDocs() {
let id = 0;
function getNewId() {
Expand Down Expand Up @@ -104,6 +138,7 @@ async function build() {
try {
await buildCSS();
await buildCSS(true);
await buildComponents();
buildDocs();
} catch (err) {
console.error(err);
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"name": "7.css",
"version": "0.7.0",
"version": "0.8.0",
"description": "A design system for building faithful recreations of the Windows 7 UI.",
"main": "dist/7.css",
"directories": {
"doc": "docs"
},
"scripts": {
"build": "node build.js",
"deploy:docs": "npm run build && gh-pages -d dist",
Expand Down

1 comment on commit bad8cac

@vercel
Copy link

@vercel vercel bot commented on bad8cac Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

7css – ./

7css-git-main-khangnd.vercel.app
7css.vercel.app
7css-khangnd.vercel.app

Please sign in to comment.