Style guide
Style without much class
CSSTable of Contents
- Introduction
- Anchors
- Articles
- Badges
- Block quote
- Bread crumbs
- Buttons
- Colors
- Comments
- Components
- Figures
- Forms
- Gallery
- Hints
- Images
- Lists
- Media
- Media box
- Modals
- Navigation
- Pre-formatted
- Prototype
- Responsive
- Screenshot
- Tables
- Tabs
- Tags
- Tree
- Typography
- Utilities
- Vertical rhythm
- 🔍︎ (search)
Introduction
This is a style guide for Sweet CSS. No comments. Look at the (pretty) plain HTML.
Todo
- Split layout, typography, provide a light version for web games
Anchors
Link (external)
Visited link (external)
Anchored mediabox
TODO hide underline a > *
TODO boxing borders
Articles
Sweet CSS can be used with or without article
s.
The main article content can be wrapped in a class .content
(deprecated)
for outstanding items (tables, figures, pre-formatted code).
In fact .content
can be used on anything (main, article,
body) to make content reasonable width. Don't nest it however (or do if
you like).
TODO prototype article with headings
012345678901234567890123456789012345678901234567890123456789
Badges
Also know as labels. To be used with contextual background classes (bg-info, bg-ok, bg-warning, bg-danger).
Info OK Warning Urgent# | Description | Labels |
---|---|---|
1 | Badge padding incorrect | Low prio Design system |
2 | Incorrect badge padding | Low prio Duplicate |
3 | White spaces matters in badges | High prioUrgent |
4 | <sup>-badges do not respect lineheight of parent | |
Block quote
TODO >cite<?
Henk wrote some time ago There is no business like show business.
Bread crumbs
Buttons
Link as button Link as button (unvisited)Colors
- .primary-color
- primary
- .brand-color
- brand
- .secondary-color
- secondary
- .tertiary-color
- tertiary
- .body-color
- body
- .background-color
- background
- .text-color
- text
Comments
Using nested block quotes:
Sjaak, Lets agree we disagree.
Ricky, No!
Components
Details
Spoiler
They all live at the end of the movie!Figures
Figures can be wrapped around almost anything. But please keep it semantic!
table cell | table cell |
table cell | table cell |
Forms
Plain
We have to think about this. Input should be smaller than textarea. Should input 80% and textarea 100% of form and let form determine the width?
As well: aside, section, article, forms (or fieldsets?) are at the same level. They are blocks with or without a title that is visually separated from the block (what if forms are nested within articles?).
Form without fieldset:
Fields should be wrapped in labels. Using the for
attribute is possible
but not needed (except for some screen readers?).
Plain with label-wrapped inputs
The parent form or field sets the total width.
Inline search form
Note that the input and button should not have whitespace in HTML.
Using a field set
Better not wrap this in an article(?)
Check boxes
Check boxes and radio buttons are grouped using a (nested) fieldset.
Using a nested fieldset:
TODO needs some tweaking to the nested legend to visual distinquish it.
Radio buttons
Other field types
Gallery
It has responsive masonry-like columns.
Hints
Images
Images within article
s are responsive by default. Outside
articles they need a class .responsive
.
Lists
- Unnumbered item 1 item item item item item item item item item item item item item item item item item item item item item tem item item item item item item item item item item item item item item item item item item tem item item item item item item item item
- Unnumbered item 2
- Unnumbered item 3
- Numbered item 1
- Numbered item 2 item item item item item item item item item item item item item item item tem item item item item item item item item
- Numbered item 3
Nested
- one
- two
- one
- two
- one
- two
Flat list .flat
- Unnumbered item 1
- Unnumbered item 2 item item item item item item item item item item item item item item item item item item item item
Definition list
- Definition term
- Definition description
- Long definition term term term term term term term term term term term term term term term term term term term term term term term term term term term
- Long definition description description description description description description description description description description description description description description description description description
- Definition term
- Definition description description description description description description description description description description description description description description description description description
Media
Audio element
Video element
Canvas element
Media box
Apple!
Lorem ipsum....
TODO stretched a instead of surrounding a
TODO smaller h1 and h2, width, padding so it can be used for article previews.
Modals
Modals are always behind an (unqiue) anchor.
Navigation
Priority menu. TODO less important items will be floated to a dropdown on smaller screens.
Pre-formatted
Pre-formatted elements belong to the outstanding items (see there). They
can be used within or without figure
s. Comes with line-numbers
for free when lines are wrapped in code
tags.
line 1
line 2
Another one without class name:
01234567890123456789012345678901234567890123456789012345678901234567890123456789
0 1 2 3 4 5 6 7
Watch your white-space!
Inline elements
<code></code>
<kbd></kbd>
<samp></samp>
<var></var>
Environment friendly.
Prototype
Wireframe look to distinguish examples from actual site design to prevent misclicking. Responsive though.
Responsive
Due to no hardcoded widths everything is responsive by nature. The only
media query is used on <article>
to keep line length within
reasonable limits.
TODO responsive SVG
Screenshot
To get a more outstanding screenshot and prevent users from confusing
the screenshot with an actual site or application .screenshot
can be used on a figure
to make it stand out.
The figcaption
is optional but can be used to create a
window caption.
Tables
No need for a class .table
because you know why.
Table header | Table header | Table header |
---|---|---|
table celll | table celll | table celll table celll table celll table celll table celll table celll |
table celll | table celll table celll table celll table celll table celll | table celll |
table celll | table celll | table celll |
table celll | table celll | table celll |
table footer |
Table without thead, tbody and tfoot sections.
Table header | Table header | Table header |
---|---|---|
table celll | table celll | table celll table celll table celll table celll table celll table celll |
table celll | table celll table celll table celll table celll table celll | table celll |
table celll | table celll | table celll |
table celll | table celll | table celll |
C64 directory listing
"VACHE RULEZ!" | SIDE1 | |
---|---|---|
0 | ------------- | DEL< |
37 | HEXTRIS | PRG< |
0 | ------------- | DEL< |
627 BLOCKS FREE. |
C64 video matrix
1 | 2 | 3 |
41 | 42 | 43 |
81 | 82 | 83 |
121 | 122 | 123 |
Tabs
Target IDs should be unique over the page.
Unordered
Ordered / numbered
Tags
Tree
- grandma
- grandpa
- father
- mother
Typography
Bold text or Strong text
Italic or Emphasized text
Strikeout text
Superscriptsup
Subscriptsub
Deleted text
Inserted text
A short quote
A definition is a description of something
abbr.
Utilities
Text emphasis
.text-ok
- This is totally OK!
.text-info
- Dinosaurs did not have opposing thumbs.
.text-warning
- Be quiet if I talk.
.text-danger
- This looks wrong to me :-(
Background emphasis
.bg-ok
-
This is totally OK!
.bg-info
-
Dinosaurs did not have opposing thumbs.
.bg-warning
-
Be quiet if I talk.
.bg-danger
-
This looks wrong to me :-(
Vertical rhythm
Add #notelines
as anchor to see it
in action.