Skip to content

Commit

Permalink
0.7.3 fix media query nested sel regression
Browse files Browse the repository at this point in the history
- add section about tools to readme
- update terser
  • Loading branch information
fuzetsu committed Sep 7, 2019
1 parent c594549 commit 69ee06d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.7.3

_2019-09-07_

Fixed regression where nested selectors in media queries would be applied incorrectly.

Added section about tools to readme.

## 0.7.2

_2019-09-05_
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ Or download the script and use it locally.

[You can see all the options here.](https://unpkg.com/zaftig@latest/dist/)

## Plugins and Tools

- [Highlight CSS Lean Strings](https://marketplace.visualstudio.com/items?itemName=fuzetsu.highlight-css-lean-strings&ssr=false#overview): a vscode plugin that will add syntax highlighting for Zaftig style strings in your JS code
- [Zaftig Tailwind](https://github.com/fuzetsu/zaftig-tailwind): a collection of helpers based on [Tailwind css](https://tailwindcss.com)

## API

Quick links: [`z`](#css) ~~ [`z.setDebug`](#set-debug) ~~ [`z.global`](#global) ~~ [`z.style`](#style) ~~ [`z.anim`](#anim) ~~ [`z.helper`](#helper) ~~ [`z.new`](#new)
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const z = Object.assign((...args) => {
const style = {
sheet: {
cssRules: [],
insertRule: function(rule, idx) {
insertRule(rule, idx) {
this.cssRules[idx] = rule
}
}
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zaftig",
"version": "0.7.2",
"version": "0.7.3",
"description": "css for your js",
"source": "src/index.js",
"main": "dist/zaftig.es5.min.js",
Expand All @@ -26,6 +26,6 @@
"homepage": "https://github.com/fuzetsu/zaftig#readme",
"devDependencies": {
"buble": "^0.19.8",
"terser": "^4.2.1"
"terser": "^4.3.0"
}
}
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,13 @@ const makeZ = (conf = {}) => {

const appendSpecial = (sel, rules, psel = '', pctx = null) => {
const media = sel.indexOf('@media') == 0
if (media) sel = sel.slice(sel.indexOf(' ') + 1)
const ctx = {
sel,
sel: media ? sel.slice(sel.indexOf(' ') + 1) : sel,
media,
sub: [],
rul: media ? wrap(psel, rules.rul) : ''
}
rules.sub.forEach(n => appendRule(n.sel, n, psel == ':root' ? '' : sel, ctx))
rules.sub.forEach(n => appendRule(n.sel, n, psel == ':root' ? '' : psel, ctx))
if (pctx) pctx.sub.push(ctx)
else appendSpecialRule(ctx)
}
Expand Down

0 comments on commit 69ee06d

Please sign in to comment.