Skip to content
This repository was archived by the owner on Mar 5, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4329c3e
adding 'to-string' function
esr360 Sep 4, 2015
d5ef5b5
making comment consistent
esr360 Sep 4, 2015
dd8c241
correcting formatting and best practices
Sep 10, 2015
14562d0
changing null to '', concatenating instead of interpolating
esr360 Sep 11, 2015
d420558
removing unnecessary interpolation & passing variable names to function
esr360 Sep 11, 2015
dfcf250
removing "to-string()" function call
esr360 Sep 14, 2015
0116f6d
synchronising with customizations
esr360 Oct 16, 2015
d6f6aef
adding a suitable readme
esr360 Oct 16, 2015
e26165c
adding bower.json
esr360 Oct 21, 2015
14379ba
removing stuff we don't need
esr360 Feb 11, 2016
5adf9a3
renaming stylesConfigJSON to modulesConfigJSON
esr360 Feb 13, 2016
466e255
removing old files
esr360 Jun 6, 2016
7a69544
adding group attribute to sassyjson files
esr360 Aug 4, 2016
120ce69
updating structure
esr360 Oct 16, 2016
2bc8959
adding bower file
esr360 Oct 16, 2016
03a85bd
adding build process stuff
esr360 Oct 16, 2016
eb851f8
updating docs
esr360 Oct 16, 2016
ff12bb6
updating readme
esr360 Oct 16, 2016
ee2c0c5
updating readme
esr360 Oct 16, 2016
5c23b87
scss linting
esr360 Oct 17, 2016
fa42555
updating readme
esr360 Oct 17, 2016
16642dd
updating readme
esr360 Oct 17, 2016
b32b51b
updating readme
esr360 Oct 17, 2016
8bff9ea
updating readme
esr360 Oct 17, 2016
d10c03b
formatting
esr360 Oct 18, 2016
f05f125
updating readme example
esr360 Oct 18, 2016
12484c3
adding unit tests
esr360 Oct 18, 2016
ca95884
updating scsslint config
esr360 Oct 20, 2016
f7217de
adding dist file
esr360 Oct 22, 2016
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
1 change: 1 addition & 0 deletions stylesheets/encode/encode.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Helpers
@import "helpers/to-string";
@import "helpers/quote";

// Type specific encoding functions
Expand Down
21 changes: 21 additions & 0 deletions stylesheets/encode/helpers/_to-string.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Joins all elements of `$list` with `$glue`
// @access private
// @param {List} $list - list to cast
// @param {String} $glue ('') - value to use as a join string

@function to-string($list, $glue: '', $is-nested: false, $recursive: false) {
$result: null;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ''.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too large indentation, I'd say?

@for $i from 1 through length($list) {
$e: nth($list, $i);
@if type-of($e) == list and $recursive {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing empty line.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list should be quoted.

$result: $result#{to-string($e, $glue, true)};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concatenation with + is usually better than direct interpolation.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing $recursive parameter?

}
@else {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Else directive should be on the same line as closing if.

$result: if(
$i != length($list) or $is-nested,
$result#{$e}#{$glue}, $result#{$e}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concatenation with + is usually better than direct interpolation.

);
}
}
@return $result;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing empty line.

}