Skip to content

Commit

Permalink
0.8.1 shave a few bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzetsu committed Oct 29, 2019
1 parent b44aa52 commit b89319d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.8.1

_2019-10-28_

Made a couple tweaks to shave some unnecessary bytes.

## 0.8.0

_2019-10-28_
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zaftig",
"version": "0.8.0",
"version": "0.8.1",
"description": "css for your js",
"source": "src/index.js",
"main": "dist/zaftig.es5.min.js",
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const makeZ = (conf = {}) => {
let { style, debug = false } = conf
let idCount = 0

const addToSheet = (sel, body, prefix = false) => {
const addToSheet = (sel, body, prefix) => {
const rule = wrap(prefix ? prefixSelector(sel) : sel, body)
if (!rule) return
if (!style) {
Expand Down Expand Up @@ -196,7 +196,7 @@ const makeZ = (conf = {}) => {
if (ctx.sub) ctx.sub.forEach(appendSpecialRule)
}

const appendSpecial = (sel, rules, psel = '', pctx = null) => {
const appendSpecial = (sel, rules, psel = '', pctx) => {
const media = sel.indexOf('@media') == 0
const ctx = {
sel: media ? sel.slice(sel.indexOf(' ') + 1) : sel,
Expand All @@ -209,7 +209,7 @@ const makeZ = (conf = {}) => {
else appendSpecialRule(ctx)
}

const appendRule = (sel, rules, psel = '', pctx = null) => {
const appendRule = (sel, rules, psel = '', pctx) => {
if (/^@(media|keyframes)/.test(sel))
return appendSpecial(sel, rules, psel == '' ? ':root' : psel, pctx)
if (psel && (!pctx || pctx.media)) sel = processSelector(sel, psel)
Expand Down

0 comments on commit b89319d

Please sign in to comment.