Documenting a Stylesheet
lsg-quickstart-stylesheet
The next few pages will be very information-dense. If you're the kind of person who takes breaks, now would be a good time a good time.
The next few pages will be very information-dense. If you're the kind of person who takes breaks, now would be a good time a good time.
To document a stylesheet, we're going to need to use two more tags:
@stylesheetto create a page for each stylesheet documented@stylesto document individual stylesWhen all of these are put together, a documented stylesheet file (
css,less, orscss) will look something like this:As a result our styleguide will start to look like this page. Don't worry about the live demos just yet--we'll get to that soon.
New Tag:
@stylesheetThe
@stylesheettag creates an individual page to document a stylesheet. Instead of creating a separate file, you'll use this tag.Example
In a file like
typography.less:This will create a page in the
stylesheetdirectory calledtypography.less.html. Like with the@pagetag, anything you write below the tag will be used as a description in the page.Arguments
The @stylesheet tag behaves similarly to the @page tag, so it has the same arguments.
NAMEis the unique name of the page for reference purposes (and will determine the name of thehtmlfile). It is often going to make sense to just makeNAMEthe name of the file (on the example Live Style Guide you will see file names listed under the titles for this reason).TITLEis the title that will be displayed on the page.New Tag:
@stylesThe
@stylestag allows you to define an individual set of styles.Example
In a file like
typography.less(that already has a@stylesheettag at the start of the file):Note: the actual styles declared below the comments will not be included in the styleguide. They are only shown for context.
Arguments
NAMEis the unique name of the page for reference purposes (but is less important in this case).TITLEis the title of the heading that will be displayed on the generated stylesheet page.Next Page