Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sass improvements #1365

Merged
merged 2 commits into from Oct 14, 2018
Merged

Sass improvements #1365

merged 2 commits into from Oct 14, 2018

Commits on Oct 6, 2018

  1. Implemented new :sass and :sass_sourcemap filters

    This commit introduces a Nanoc aware Sass importer that:
      - does not rely on monkey patching Sass Filesystem importer implementation
      - reasons about items instead of file which means:
        - you can import by identifier
        - you can import by pattern
        - you can import in memory and/or filtered items
    gpakosz committed Oct 6, 2018
    Copy the full SHA
    97e025e View commit details
    Browse the repository at this point in the history
  2. Added nanoc() sass custom function

    Example usage, from within sass code:
    
    @if nanoc('@config.dig(:items, :headings, :auto_number)') {
       body { counter-reset: h2; }
       h2 { counter-reset: h3; }
       h3 { counter-reset: h4; }
       h4 { counter-reset: h5; }
       h5 { counter-reset: h6; }
    
       h2:before { counter-increment: h2; content: counter(h2) ". "; }
       h3:before { counter-increment: h3; content: counter(h2) "." counter(h3) ". "; }
       h4:before { counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ". "; }
       h5:before { counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "; }
       h6:before { counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "; }
    
       h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.nocount:before { content: ""; counter-increment: none; }
    }
    
    Or even,
    
    .title {
      color: nanoc('@config[:title][:color]', $unquote: true)
    }
    gpakosz committed Oct 6, 2018
    Copy the full SHA
    dbd6af6 View commit details
    Browse the repository at this point in the history