expandobem's Issues
Support class grouping
I'd like to support class grouping, similarly to that described by Harry Roberts.
Based on Harry's example:
<div class='[ foo bar ] baz'>
Would compile to:
<div class='foo foo--bar baz'>
My current idea is to take the first class from the group and use it as the block/element qualifier, with all following classes in the group being modifiers.
This would be an opt in compile mode. I don't think the group syntax needs to be configurable; I'm inclined to just use []
for simplicity.
Simple Test fails (gulp)
Hello,
I have my test.jade with:
h1 Test!
when running it like this:
gulp.task('jade', function () {
return gulp.src('test.jade')
.pipe(jade({ pretty: true }))
.pipe(transform(expandobem.processStream))
.pipe(gulp.dest('html'));
});
the resulting HTML looks like... this:
<h11>Test!</h1>
With proper doctype, head, body, etc. it works as it should, by the way.
Typo in bin.js
'use strict';
Custom modifier syntax always replaced with `--`
ExpandOBem will correctly recognise and transform classes with custom modifier syntax, but always uses --
to join output classes.
For example, compiling the class attribute foo@@bar
with custom modifier syntax set to @@
results in foo foo--bar
. The output should be foo foo@@bar
.
processStream error without giving options
Hello again,
I get the following error when trying to just use expandobem.processStream without any options:
/.../node_modules/expandobem/index.js:168
includes(singleClass, options.syntax.element) ||
^
TypeError: Cannot read property 'element' of undefined
However, when passing the default options through, everything works fine, e.g.:
.pipe(transform(expandobem.processStream({
syntax: {
element: '__',
modifier: '--'
}
})))
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.