Skip to content

Commit

Permalink
Version added to card
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonym-tsk committed Jan 10, 2024
1 parent 079243b commit 8fcb02f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import imagemin from 'imagemin';
import imageminPngquant from 'imagemin-pngquant';
import replace from 'replace-in-file';
import fs from 'fs-extra';
import pkg from "../package.json" assert { type: 'json' };

fs.mkdirp('./tmp/assets');
fs.emptyDirSync('./tmp/assets');
Expand Down Expand Up @@ -36,10 +37,12 @@ fs.emptyDirSync('./tmp/assets');
});

fs.readFile('./src/starline.html', 'utf8', function(err, contents) {
const versionTag = `<div class="version">${pkg.version}</div>`;

replace.sync({
files: './tmp/starline-card.js',
from: '{%html%}',
to: contents,
to: versionTag + contents,
});

fs.copySync('./tmp/starline-card.js', './dist/starline-card.js');
Expand Down
8 changes: 8 additions & 0 deletions src/starline.sass
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
@import 'styles/controls'
@import 'styles/icons'

.version
position: absolute
bottom: 5px
right: 5px
opacity: .3
font-size: .7em
line-height: .7em

.wrapper
overflow: hidden
position: relative
Expand Down

0 comments on commit 8fcb02f

Please sign in to comment.