franzheidl / bemify Goto Github PK
View Code? Open in Web Editor NEWSass Mixins to write BEM-style SCSS source
License: MIT License
Sass Mixins to write BEM-style SCSS source
License: MIT License
I insist particularly on con # 3. Because it's impossible to search for things like block__element
in the .scss files, this abstraction makes onboarding new people on a codebase or trying to refactor very difficult.
Do people use bemify on large projects in teams of more than 2 people? If so, what were the results?
Would it be fair to warn potential users of this library (in the README for example) that this might have adverse effects on the searchability of their codebase?
Not an issue but thought I'd let you know that the __child--bad/.ishappy example of the .io/bemify is wrong. It has .my-element__child--bad.is-happy rather than .my-element__child.is-happy. On github readme it's correct though.
Hope this helps.
I get this error when compiling the sass
The following modules did not declare an eyeglass version:
bemify
Please add the following to the module's package.json:
"eyeglass": { "needs": "^0.8.2" }
With the element
mixin only doing:
@mixin element($name) {
@at-root {
&#{$element-separator}#{$name} {
@content;
}
}
}
users are unable to make psuedo selectors on the containing block
/element
and then styles on an element
underneath:
+block("breadcrumbs")
+clearfix
display: block
+element("link")
color: blue
text-decoration: underline
&:after
content: ">"
+element("item")
float: left
display: block
/* on the last .breadcrumbs__item */
&:last-child
/* any .breadcrumbs__link underneath */
+element("link")
/* those link's :after psuedo selector... */
&:after
display: none
would compile into:
/* ... */
.breadcrumbs__item:last-child__link:after { display: none; }
The element
mixin should scan the parent selector (&
) and strip out the anything but the original block
or element
.
See this example of the broken element
mixin and this example of the smarter element
mixin. Also this conversation on css-tricks.com.
I receive this error when the compiler builds code in sass --watch project.
Syntax error: Invalid CSS after "...ator}#{$prefix}": expected "{", was "-#{$state} {"
"-#{$state" may only be used at the beginning of a compound selector. on line 69 of bower_components/bemify/sass/_bemify.scss from line 1 of sass/styles.scss
64:}
Make bemify work with eyeglass.
I was able to get it working, but the necessary syntax proves cumbersome. E.g.:
@include element ('item') {
@include state (error, has) {
// * issue starts here, where output should be `.form__item-error`
@include block ('form') { // * how to achieve the above without this line?
@include element ('item-error') {
display: block;
}
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.