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:
@stylesheet
to create a page for each stylesheet documented@styles
to 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:
@stylesheet
The
@stylesheet
tag 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
stylesheet
directory calledtypography.less.html
. Like with the@page
tag, 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.
NAME
is the unique name of the page for reference purposes (and will determine the name of thehtml
file). It is often going to make sense to just makeNAME
the name of the file (on the example Live Style Guide you will see file names listed under the titles for this reason).TITLE
is the title that will be displayed on the page.New Tag:
@styles
The
@styles
tag allows you to define an individual set of styles.Example
In a file like
typography.less
(that already has a@stylesheet
tag 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
NAME
is the unique name of the page for reference purposes (but is less important in this case).TITLE
is the title of the heading that will be displayed on the generated stylesheet page.Next Page