Skip to content

Commit

Permalink
Merge pull request #54 from leopic/addingSupportForColumnSpan
Browse files Browse the repository at this point in the history
Adding support for `column-span`.
  • Loading branch information
Igosuki authored Apr 16, 2021
2 parents 6cca941 + 386c44d commit e20dc20
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/compass/css3/_columns.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
);
}

// Specify how many columns an element should span across.
// * legal values are none, all
@mixin column-span($columns) {
@include experimental(column-span, $columns,
-moz, -webkit, -o, -ms, not(-khtml), official
);
}

// Specify the width of the rule between columns e.g. `1px`
@mixin column-rule-width($width) {
@include experimental(column-rule-width, $width,
Expand Down
36 changes: 36 additions & 0 deletions test/css3/columnsSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
var render = require('../helper/render');
var ruleset = require('../helper/ruleset');

describe("CSS3 Columns", function () {

it("should generate column-span properties with value: `none`", function (done) {
var input = '@include column-span(none);',
expectation = '-webkit-column-span:none;-moz-column-span:none;-ms-column-span:none;-o-column-span:none;column-span:none';

render(ruleset(input), function(output, err) {
expect(output).toBe(ruleset(expectation));
done();
}, ['compass/css3/columns']);
});

it("should generate column-span properties with value: `all`", function (done) {
var input = '@include column-span(all);',
expectation = '-webkit-column-span:all;-moz-column-span:all;-ms-column-span:all;-o-column-span:all;column-span:all';

render(ruleset(input), function(output, err) {
expect(output).toBe(ruleset(expectation));
done();
}, ['compass/css3/columns']);
});

it("should generate column-span properties with invalid value", function (done) {
var input = '@include column-span(3);',
expectation = '-webkit-column-span:3;-moz-column-span:3;-ms-column-span:3;-o-column-span:3;column-span:3';

render(ruleset(input), function(output, err) {
expect(output).toBe(ruleset(expectation));
done();
}, ['compass/css3/columns']);
});

});

0 comments on commit e20dc20

Please sign in to comment.