question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change list separator

See original GitHub issue

It doesn’t seem possible to change the seaprator of a list. I propose a function change_separator or similar.

I found a need for this, as sometimes one is not in control where a list comes from or how it’s created. Using a framework, or using a built-in function that builds you a list like map_values. Sometimes you just always get one separator, when you need to other.

Another option is to give control over how a list is rendered to the output. That is to say, allow overriding the separator when outputting it.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
davidkpianocommented, May 28, 2015
@function set-separator($list, $separator: list-separator($list)) {
  @if $separator == 'comma' or $separator == 'space' {
    @return join($list, (), $separator);
  }
  @error 'Not a valid separator: #{$separator}';
}

$foo: set-separator(1 2 3, comma);
// => 1, 2, 3
1reaction
thanycommented, May 28, 2015

And how do I change ONLY the separator, without putting the list through a join function?

Look, I understand you don’t want to cencern yourself with petty issues like this, I get it. But you make it look like I’m just whining. I’m trying to suggest ways to make Sass nicer to work with. If you prefer keeping Sass a more verbose and potentially less efficient language, fine, but then just say so up front.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing List separator to Comma - Microsoft Community
I've changed List separator from semicolon to comma(and saved it). But it seemed that List separator was still semicolon.
Read more >
Change List Item Separator - Online List Tools
This is a super simple browser-based application that changes the separator of items in any list. It can modify single character separators (such...
Read more >
Excel List separator | Exceljet
By default, Excel uses the list separator defined under regional settings in Control Panel. The US English version of Excel uses a comma...
Read more >
Changing Regional Setting in Windows (CSV imports)
Close the Excel application · Click on the Windows/Start button · Select Control Panel · Select Region and Language · Click on Formats...
Read more >
Opening Excel files with the correct CSV list separator
Windows · Open the Windows Start Menu and click Control Panel · Open the Regional and Language Options dialog box · Click the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found