Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

use unique name for each wrapped selector #28

Merged
merged 1 commit into from
May 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/utils/general.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// selector count
let count = 0

/**
* Based on https://github.com/mapbox/stylelint-processor-markdown
* @author @davidtheclark
Expand Down Expand Up @@ -45,7 +48,8 @@ const isLastLineWhitespaceOnly = (text) => {
return true
}

const wrapSelector = (content) => `.selector {${content}}\n`
// eslint-disable-next-line no-return-assign
const wrapSelector = (content) => `.selector${count += 1} {${content}}\n`
const wrapKeyframes = (content) => `@keyframes {${content}}\n`

exports.wrapKeyframes = wrapKeyframes
Expand Down