Comments (10)
I second this request.
It would be very helpful to be able to use a sass variable in the description of the doc.
Sometimes we create custom examples for the style guide, beyond what the modifiers/markup allows us to do. It would be helpful to be able to use the sass variables in these examples so that if they change the example is updated automatically.
from kss-node.
I want to clarify what this issue is about. Are you wanting to
- Document Sass variables? i.e. Add a KSS documentation block for a Sass variable (or group of variables) and have kss-node generate docs with examples. or:
- Use a Sass variable inside your Markup section and have kss-node replace it with the actual value of the variable?
I'm interested in option 1, btw.
from kss-node.
Closing this in favor of the approach outlined in #50.
from kss-node.
Hi @JohnAlbin I was actually looking to do option 2. Currently I have examples of color swatches in my documentation, but because the sass variables don't get replaced, I have to hard code the values. In cases where I'm using color functions like darken, lighten, or transparentize, it's kind of a bummer.
I'm not sure actually that #50 solves this issue.
Sorry for the late reply
from kss-node.
I'm not sure actually that #50 solves this issue.
No, I had to assume you meant option #1. Re-opening.
from kss-node.
Any update on this?
Will this feature come? It would be awesome if something like that would be working:
/* Colors
Base colors
Markup:
<div style="background:#{$primary-color}" class="styleguide-color">$primary-color</div>
<div style="background:#{$primary-color-inverted}" class="styleguide-color">$primary-color-inverted</div>
Styleguide 1.1
*/
from kss-node.
Any update on this?
I've got other features on my to-do list before this one. But I'm not preventing anyone from tackling it.
from kss-node.
BTW, with Sass 3.4, you can put this in your .scss file:
$variable: 'hi';
/**
* #{$variable} there!
*/
And that will compile to:
/**
* hi there!
*/
Which means you could use CSS-style comments with inline-sasscript variables in your Sass files and point kss-node at the generated CSS.
from kss-node.
This might be useful too: https://www.npmjs.org/package/sassyjson
from kss-node.
The more I think about this feature, the more I realize the problem is trying to get very specific variables out of a CSS preprocessor into the template and displayed in very specific ways in the style guide. I don't think there is a good generic way to do this.
from kss-node.
Related Issues (20)
- 3 level navigation
- An in-range update of twig is breaking the build 🚨 HOT 1
- How can I forward options into twig.js?
- ScrollSpy conflict
- Define styleguide components in the template directly HOT 2
- Generate example html from SASS? HOT 1
- Use different builders for different sections of the styleguide?
- Does not work if not installed globally
- v3.0.1 failing with permissions issues HOT 6
- v.3.0.0 Update may require relative path changes to projects HOT 1
- kss not recognizing handlebars code HOT 1
- v3.0.1 outputs: "Version 9 of Highlight.js has reached EOL" HOT 9
- Node versions >= 14
- Update SASS in kss-node-handlebars-builder
- Add option to load JavaScript in rendered styleguide as ES6 module HOT 1
- Extending handlebars helpers not working. v3.1.0 HOT 1
- Question: Do I need to write any javascript to extend handlebars to register partials? HOT 2
- Can I show variables with encoded SVG icons in the styleguide without hard-coding the values?
- ::selection as a modifier HOT 1
- kss-node multiple markup on page?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kss-node.