Giter VIP home page Giter VIP logo

Comments (7)

winstromming avatar winstromming commented on September 1, 2024

@mmintel I've also considered adding this. It involves quite a bit of work (or heavy regex) because, as you say, Sassdown does not actually compile the Sass itself. Marking this as a future feature for now, though.

from sassdown.

m5o avatar m5o commented on September 1, 2024

This is technically possible. Sass can interpolate strings in comments, but they will only print out to a string when compiling to CSS and using the CSS comments /* */

Test this code online with http://sassmeister.com/

$buttonClass: 'btn';
$colorPrimary: #FF0;

/*
# Test
Use #{$buttonClass} for a button. The primary color is #{$colorPrimary}
*/

// not working with single line comments #{$buttonClass}

from sassdown.

winstromming avatar winstromming commented on September 1, 2024

Yep, it's possible - just need to investigate and get around to it.

from sassdown.

idflood avatar idflood commented on September 1, 2024

Hi, I wanted to make a new issue with a pull request but I think this may solve partially this issue.

When following BEM syntax we frequently add modifiers to the same html structure. For example a simple button may have many 'color' variants:

<a href="#" class="button button--yellow">yellow</a>
<a href="#" class="button button--purple">purple</a>
<a href="#" class="button button--submarine">submarine</a>
<a href="#" class="button button--rain">rain</a>
<a href="#" class="button button--fog">fog</a>
...

If we compile the result we can simplify this with the addition of a 'split' handlebar helpers.

{{#each (split "yellow, purple, submarine, rain, fog")}}
  <a href="#" class="button button--{{this}}">{{this}}</a>
{{/each}}

Compiling the result eventually become even more interesting with more complicated structures.

{{#each (split "status, success, warning, error")}}
  <div class="message message--{{this}}">
    Message type "{{this}}" example.
    <a href="#" class="message__close"><i class="icon icon--close"></i></a>
  </div>
{{/each}}

Now, I'm not 100% sure this would help with this specific issue. Let me know if I need to adapt my changes or make a different pull request.

from sassdown.

mmintel avatar mmintel commented on September 1, 2024

Is there any kind of workaround until this is implemented? I am really missing this feature =( I tried to use the compiled .css file for sassdown but then I am losing the navigation because there is just one file

from sassdown.

winstromming avatar winstromming commented on September 1, 2024

@mmintel Sorry, not yet. You could have a look at the pull request by @idflood (idflood@536a129). I've not had the time to work on this for a while, but it's still on the list.

from sassdown.

AdrianoCahete avatar AdrianoCahete commented on September 1, 2024

+1

from sassdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.