Giter Club home page Giter Club logo

Comments (12)

ryuran avatar ryuran commented on July 20, 2024 3

My way with custom field and twig extend (I have a handlebars version too):

Result: http://20minutes.github.io/colette/section-settings.html#kssref-settings-colors

You can style it.

But stay duplicate date (code vs comment).
The main raison is, KSS do not parse the code to keep support for every languages (css/less/sass/scss/stylus). Parse code could be complexe.

from kss-node.

daften avatar daften commented on July 20, 2024 1

I would mainly find this interesting to document the color scheme for the theme I'm working on and have a visual representation of the colors. Is the only possibility to create classes for that color (that just use that variable) and use those classes as modifiers?

from kss-node.

sioked avatar sioked commented on July 20, 2024

Not sure if this is exactly what you're looking for, but all kss comments are parsed via markdown (specifically GitHub Flavored Markdown by default), so it's possible to include a code block for any other code that you would like to display. I use this to add some documentation around how to use some javascript that goes along with one of the components I'm documenting (i.e. how a custom dropdown looks and how to hook up the javascript to get it to function).

As far as I've seen, there is no ability to include all of your source code around specific comments like styledocco does (Doesn't seem to really fit the kss style of documentation).

from kss-node.

indieveed avatar indieveed commented on July 20, 2024

ok, your point makes sense. May be including something like source map could be a good feature to fit the kss style? Just to know wich line is responsible for what i see in a styleguide. But may be i just need to structure my code better and this problem will go away

from kss-node.

JohnAlbin avatar JohnAlbin commented on July 20, 2024

Actually, I was thinking about a feature like this in order to properly document Sass variables. Something like:

// Sass color variables
//
// code block:
$my-var: 'foo';
$my-var2: 'bar';
// etc.
$my-var3: 'baz';
// end code block
//
// Styleguide 1.2

FYI, the "end code block" (or similar) would be required to make it possible to include comments within the code block. It would also make parsing drop dead simple.

Not sure if breaking a KSS doc block in half with code block section would work, but its something to investigate.

from kss-node.

daften avatar daften commented on July 20, 2024

For colors and base HTML elements (and e.g. icons), there should be an example, without markup, similar to how bootstrap does it IMO.
So for colors, showing the variable is fine, but the only way i see to show an example is with custom css classes made for this and a markup section.

from kss-node.

JohnAlbin avatar JohnAlbin commented on July 20, 2024

Can you provide a screenshot or link to explain your "similar to how bootstrap does it" example?

from kss-node.

daften avatar daften commented on July 20, 2024

For icons: http://getbootstrap.com/components/
For typography (very basically): http://getbootstrap.com/css/#type

The base elements such as headings and paragraphs do interfere with the template look-and-feel though, but that's another problem :)

I'll provide some of my snippets on how I've solved it now later today normally.

from kss-node.

liyuankui avatar liyuankui commented on July 20, 2024

It would be great with features like:
font.less:

// Font color
// .font-strong - for bigger contrast
// Markup:
// <span class="{$modifiers}">testing text</span> has less variable {$variable}
// Styleguide 1.1
.font-strong {
  color:@text-color-black
}

renders to:

Font color
.font-strong for bigger contrast
<span class="font-strong">testing text</span> has less variable @text-color-black

from kss-node.

erfanimani avatar erfanimani commented on July 20, 2024

Github's styleguide has something similar to that what is being requested in this issue: http://primercss.io/colors/

But, unfortunately, theirs doesn't seem to be automatically generated either: https://raw.githubusercontent.com/primer/primer/master/docs/colors.md

from kss-node.

vidhill avatar vidhill commented on July 20, 2024

I'm just going to add this as a reference for others looking into this,

The project sc5-styleguides, which uses kss-node as a dependency achieves this.

They use gonzales-pe in combination with gonzales-ast to parse sass sourse.

Their source is here

from kss-node.

tsi avatar tsi commented on July 20, 2024

This is my work-around for a color list, it's far from perfect, and I have to maintain 2 lists, but it works.

// Colors
//
// #97007A - : Magenta
// #424344 - : Grey
// #28292A - : Dark grey
//
// Markup: <div style="background: {{modifier_class}};" class="styleguide-color">{{modifier_class}}</div>
//
// Styleguide 1

$color--magenta: #97007A;
$color--grey: #424344;
$color--grey-dark: #28292A;

from kss-node.

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.