Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

No explicit mixing for LESS #310

Merged
merged 3 commits into from
Jan 16, 2016
Merged
Show file tree
Hide file tree
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
13 changes: 6 additions & 7 deletions tasks/templates/bem.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
<% } %>
<% if (baseStyles) { %>.<%= baseClass %><% if (addLigatures) { %>,
.ligature-icons<% } %> {
font-family:"<%= fontBaseName %>";
<% if (stylesheet === 'less') { %>&:before {<% } %>
font-family:"<%= fontBaseName %>";
<% if (stylesheet === 'less') { %>}<% } %>
display:inline-block;
vertical-align:middle;
line-height:1;
Expand All @@ -35,17 +37,14 @@

<% if (iconsStyles) { %>/* Icons */<% for (var glyphIdx = 0; glyphIdx < glyphs.length; glyphIdx++) { %>
<% if (stylesheet === 'less') { %>
.<%= mixinPrefix %><%= glyphs[glyphIdx] %>() {
.<%= classPrefix %><%= glyphs[glyphIdx] %> {
&:before {
content:"<% if (addLigatures) { %><%= glyphs[glyphIdx] %><% } else { %>\<%= codepoints[glyphIdx] %><% } %>";
}
<% if (ie7) {%>
}<% if (ie7) {%>
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#x<%= codepoints[glyphIdx] %>;');
<% } %>
}
.<%= classPrefix %><%= glyphs[glyphIdx] %>{
.<%= mixinPrefix %><%= glyphs[glyphIdx] %>();
}<% } else { %>
<% } else { %>
<% if (ie7) {%>.<%= classPrefix %><%= glyphs[glyphIdx] %> {
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#x<%= codepoints[glyphIdx] %>;');
}
Expand Down
14 changes: 7 additions & 7 deletions test/webfont_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ exports.webfont = {
svgs.forEach(function(file) {
var id = path.basename(file, '.svg');
test.ok(
find(less, '.icon-' + id + '() {\n\t&:before'),
find(less, '.icon_' + id + ' {\n\t&:before'),
'LESS Mixin ' + id + ' should be in CSS file.'
);
});
Expand Down Expand Up @@ -569,12 +569,12 @@ exports.webfont = {
// Every SVG file should have corresponding entry in LESS and HTML files
svgs.forEach(function(file) {
var id = path.basename(file, '.svg');
// test.ok(
// find(less, '.make-icon-' + id + ' {'),
// 'Mixin .make-icon-' + id + ' should be in LESS file.'
// );
test.ok(
find(less, '.make-icon-' + id + '() {'),
'Mixin .make-icon-' + id + ' should be in LESS file.'
);
test.ok(
find(less, '.glyph_' + id + '{'),
find(less, '.glyph_' + id + ' {'),
'Icon .glyph_' + id + ' should be in LESS file.'
);
test.ok(
Expand Down Expand Up @@ -831,7 +831,7 @@ exports.webfont = {

target_overrides: function(test) {

var css = grunt.file.read('test/tmp/target_overrides_css/icons.css');
var css = grunt.file.read('test/tmp/target_overrides_css/icons.css');
test.ok(fs.existsSync('test/tmp/target_overrides_css/icons.css') + ' file created.');

'woff,ttf,eot'.split(',').forEach(function(type) {
Expand Down