Build websites with COCO
A lightweight, JavaScript-free CSS framework.
Use semantic HTML and document code with SassDoc.
Styles should support the content.
# COCO 2.3.0 Complete Reference COCO is a JavaScript-free CSS framework. This file is generated from KSS and SassDoc comments. Prefer the documented semantic markup and class names. # CSS Components ## Grid Reference: 1.1 Category: Layout Source: scss/element/_grid.scss:21 Place columns inside a row and container. Responsive column classes use the configured breakpoint name, for example `.col-md-6`. Modifiers: - None Markup: ```html
A lightweight, JavaScript-free CSS framework.
Use semantic HTML and document code with SassDoc.
Styles should support the content.
Content before the break.
Content after the break.
``` ## Attributed quotation Reference: 2.5 Category: Content Source: scss/element/_typography.scss:31 `.quote` groups a quotation and attribution with consistent spacing. Use a `blockquote` for the quoted content and a `figcaption` for its source. Modifiers: - None Markup: ```htmlGood design makes the useful understandable.
| Version | Status |
|---|---|
| 2.3.0 | Current |
| 2.2.0 | Previous |
Heading-sized text
``` ## Copyable text Reference: 6.4 Category: Utilities Source: scss/element/_typography.scss:46 `.copy` selects all of an element's text when users interact with it. It is useful for identifiers and short values that are commonly copied. Modifiers: - None Markup: ```html@blockchainhub/coco
```
## Version indicator
Reference: 7.2
Category: Reference
Source: scss/config/_info.scss:3
Add `.coco.version` to an element to insert the framework version with CSS.
Include a readable prefix in the element because the generated content alone
should not carry essential information.
Modifiers:
- None
Markup:
```html
COCO version
```
# Sass API
## escaping-characters
Type: variable
Source: scss/config/_escaping-characters.scss:2
Characters to escape using SVG as data:image.
Parameters:
- None
## em.oji
Type: css
Source: scss/element/_emoji.scss:24
Emoji are ideograms and smileys used in electronic messages and web pages. Emoji exist in various genres.
Parameters:
- None
## .filter.seventyseven
Type: css
Source: scss/filters/_1977.scss:5
1977 effect. As the name suggests, this filter gives you a nostalgic 70βs feel by making photos brighter as well as faded.
Parameters:
- None
## .filter.aden
Type: css
Source: scss/filters/_aden.scss:5
Aden is famous for its retro, pastel-y look, which works great if you need to soften harsh lights.
Parameters:
- None
## .filter.amaro
Type: css
Source: scss/filters/_amaro.scss:5
This filter adds more light to the center of the photo and darkens around the edges.
Parameters:
- None
## .filter.brannan
Type: css
Source: scss/filters/_brannan.scss:5
Brannan adds high contrast and exposure to your photo, giving it some stylish metallic tint. This photo effect is soft and washed out, like a photo from old grannyβs album.
Parameters:
- None
## .filter.brooklyn
Type: css
Source: scss/filters/_brooklyn.scss:5
Brooklyn brightens up your image and boosts its yellow tones. Depending on the image, it can give it an ethereal look.
Parameters:
- None
## .filter.chessboard
Type: css
Source: scss/filters/_chessboard.scss:5
Chessboard effect - black and white geometric checkered pattern. Mostly best for backgrounds.
Parameters:
- None
## .filter.clarendon
Type: css
Source: scss/filters/_clarendon.scss:5
Clarendon filter will brighten the highlights found in your photos, while also making the shadows a bit bolder.
Parameters:
- None
## .filter.earlybird
Type: css
Source: scss/filters/_earlybird.scss:5
Earlybird to get a retro βPolaroidβ feel with soft faded colors and a hint of yellow.
Parameters:
- None
## .filter.gingham
Type: css
Source: scss/filters/_gingham.scss:5
Gingham muddy highlights, brightness, a slight haze and a subtle warm up of the tones by carefully applying red and magenta to selected parts of the image.
Parameters:
- None
## .filter.hudson
Type: css
Source: scss/filters/_hudson.scss:5
Hudson emphasizes light in your image and gives your photos a bluish, colder feel.
Parameters:
- None
## .filter.inkwell
Type: css
Source: scss/filters/_inkwell.scss:5
Inkwell adds high contrast and also makes your photos black and white.
Parameters:
- None
## color
Type: function
Source: scss/function/_color.scss:13
Get any color value from $colors (or any) Sass map.
Parameters:
- key (string): The key name of the color.
- type (string): The type of the color group (base, dark, etc.).
- only-color (boolean): If true, return only the color value.
- map (map): The map to get the color from.
Returns: color β The color value or the variable.
## color-value
Type: function
Source: scss/function/_color.scss:43
Get a raw color value from $colors (or any) Sass map.
Parameters:
- key (string): The key name of the color.
- type (string): The type of the color group (base, dark, etc.).
- map (map): The map to get the color from.
Returns: color β The color value.
## color-contrast
Type: function
Source: scss/function/_color.scss:63
Get a white or black contrast color based on perceived brightness.
Thanks for David Halford for this function: https://codepen.io/davidhalford/pen/ALrbEP
Parameters:
- color (color): The color to get the contrast color.
Returns: color β The contrast color.
## config
Type: function
Source: scss/function/_config.scss:12
Get the value of a key from a map.
Parameters:
- key (string): The key name.
- map (map): The map to get the value from.
- custom-property (boolean): Whether to return the value as a CSS custom property.
Returns: string β The value of the key.
## get-css-variable
Type: function
Source: scss/function/_css-variable.scss:9
Add the prefix value to a CSS custom properties.
Parameters:
- var (string): The name of the CSS custom property.
Returns: string β The CSS custom property with the prefix.
## font-size
Type: function
Source: scss/function/_font-size.scss:12
Get the font size of a key from the $font-sizes map.
Parameters:
- key (string): The key name.
- fluid (boolean): Whether to return the fluid font size.
- scaler (number): The scaler value (15 = 15% smaller).
- optimal-size (number): The optimal font size.
Returns: string β The font size of the key.
## responsive-font-size
Type: function
Source: scss/function/_font-size.scss:44
Generate responsive font-size value using clamp().
Parameters:
- size (number): The font size.
- scaler (number): The scaler value (15 = 15% smaller).
- optimal-size (number): The optimal font size.
Returns: string β The responsive font-size value.
## setting
Type: function
Source: scss/function/_setting.scss:8
Get a value from the $settings map.
Parameters:
- key (string): The key name.
Returns: string β The value of the key.
## split-values
Type: function
Source: scss/function/_spacer.scss:10
Split a string into a list of values.
Parameters:
- value (string): The string to split.
- separator (string): The separator to split by.
Returns: list β The list of values.
## spacer
Type: function
Source: scss/function/_spacer.scss:27
Get spacer value from $spacers map.
Parameters:
- key (string): The key name.
Returns: string β The value of the key.
## spacer-clamp
Type: function
Source: scss/function/_spacer.scss:54
Get value returned in a clamp from $spacers maps.
Parameters:
- min (string): The minimum value.
- max (string): The maximum value.
- optimal (string): The optimal value.
Returns: string β The value returned in a clamp.
## svg-escape
Type: function
Source: scss/function/_utilities.scss:24
Escape a string to be used as a data URI.
Parameters:
- string (String): The string to escape.
Returns: String β The escaped string.
## breakpoint
Type: mixin
Source: scss/mixin/_breakpoint.scss:9
Return a media query for a breakpoint based on min-width.
Parameters:
- breakpoint (string): The breakpoint name.
- logic (string): The logic operator.
Output: The media query.
## btn-focus-helper
Type: mixin
Source: scss/mixin/_button.scss:11
Generate a button focus ring.
Parameters:
- type (string): The type of the button for the color value.
- focus (boolean): If the focus ring should be generated.
Output: The generated focus ring.
## btn-variant
Type: mixin
Source: scss/mixin/_button.scss:41
Generate a button variant.
Parameters:
- type (string): The type of the button for the color value.
- focus (boolean): If the focus ring should be generated.
Output: The generated button variant.
## btn-variant-outline
Type: mixin
Source: scss/mixin/_button.scss:83
Generate a button variant with outline.
Parameters:
- type (string): The type of the button for the color value.
- focus (boolean): If the focus ring should be generated.
Output: The generated button variant with outline.
## generate-color-variables
Type: mixin
Source: scss/mixin/_color.scss:9
Generate color variables.
Parameters:
- colors (map): The colors map.
- selector (string): The selector.
Output: The generated color variables.
## set-css-variable
Type: mixin
Source: scss/mixin/_css-variable.scss:9
Declare CSS custom properties to add the prefix.
Parameters:
- vars (map): The CSS custom properties.
Output: Prefixed CSS custom-property declarations.
## font-face
Type: mixin
Source: scss/mixin/_font-face.scss:12
Generate font-face declaration.
Parameters:
- font-family (string): The font family name.
- src (string): The font source.
- font-weight (number): The font weight.
- font-style (string): The font style.
- font-display (string): The font display.
Output: The generated font-face declaration.
## focus-ring
Type: mixin
Source: scss/mixin/_form.scss:15
Generate a form focus ring.
Parameters:
- type (string): The type of focus ring (box-shadow, outline).
- border-color (string): The border color.
- ring-color (string): The ring color.
- box-shadow-type (string): The box shadow type (outset, inset).
- ring-size (string): The ring width.
- ring-offset (string): The ring offset.
Output: The generated focus ring.
## field-disabled
Type: mixin
Source: scss/mixin/_form.scss:47
Style field disabled input states.
Parameters:
- background (string): The background color.
- border (string): The border color.
Output: The generated disabled input states.
## field-icon
Type: mixin
Source: scss/mixin/_form.scss:60
Get custom icon background for input and select fields.
Parameters:
- icon (string): The icon as an SVG string.
- color (string): The color.
Output: The generated icon background.
## form-group-stacked
Type: mixin
Source: scss/mixin/_form.scss:70
Create a form group stacked layout with custom breakpoint.
Parameters:
- breakpoint (string): The breakpoint.
Output: The generated form group stacked layout.
## generate-styles
Type: mixin
Source: scss/mixin/_generator.scss:10
Generate all the styles.
Parameters:
- None
## layout-center
Type: mixin
Source: scss/mixin/_layout.scss:12
Create center layout.
Parameters:
- gap (string): The gap between the container and the content.
- max-inline-size (string): The maximum width (inline-size) of the container.
Output: The centered layout.
## layout-stack
Type: mixin
Source: scss/mixin/_layout.scss:32
Create stack layout.
Parameters:
- gap (string): The gap between the elements.
- inline-size (boolean): Whether it has explicit width (inline-size).
- align (string): The horizontal alignment of the elements.
- important (boolean): Whether it should use the !important keyword.
Output: The stacked layout.
## layout-grid
Type: mixin
Source: scss/mixin/_layout.scss:77
Create grid layout.
Parameters:
- gap (string): The gap between the elements.
- minimum (string): The minimum width (inline-size) of the elements.
Output: The grid layout.
## layout-sidebar
Type: mixin
Source: scss/mixin/_layout.scss:101
Create sidebar layout.
Parameters:
- gap (string): The gap between the elements.
- inline-size (string): The width (flex-basis) of the sidebar.
Output: The sidebar layout.
## layout-flex
Type: mixin
Source: scss/mixin/_layout.scss:131
Create instinctive flex layout.
Parameters:
- gap (string): The gap between the elements.
- inline-size (string): The width (inline size) of the elements.
Output: The instinctive flex layout.
## selection
Type: mixin
Source: scss/mixin/_selection.scss:10
Set the ::selection of an element with automatic foreground color.
Parameters:
- background (color): The background color.
- foreground (color): The foreground color. If null, the color will be automatically calculated.
- is-direct (boolean): If true, the selection will be applied to the current element if false it will be applied to its children.
Output: The selection mixin.
## transition
Type: mixin
Source: scss/mixin/_transition.scss:10
Generates transition related declarations.
Parameters:
- duration (string): The duration of the transition.
- property (string): The property to which the transition is applied.
- timing-function (string): The speed curve of the transition.
Output: The generated transition declarations.
## visually-hidden
Type: mixin
Source: scss/mixin/_utilities.scss:9
Hide something from the screen but keep it visible for assistive technology.
Parameters:
- None
Output: The visually hidden mixin.
## text-ellipsis
Type: mixin
Source: scss/mixin/_utilities.scss:25
Crop text and display an ellipsis with multiline.
Parameters:
- number-of-lines (number): The number of lines.
Output: The text ellipsis mixin.
## scrollbar
Type: mixin
Source: scss/mixin/_utilities.scss:51
Custom scrollbar.
Parameters:
- thumb-background-color (string): The background color of the thumb.
- thumb-background-color-hover (string): The background color of the thumb when hovered.
- track-background-color (string): The background color of the track.
- size (string): The size of the scrollbar.
- border-radius (string): The border radius of the scrollbar.
Output: The scrollbar mixin.
## clear-btn
Type: mixin
Source: scss/mixin/_utilities.scss:80
Clear default button styles.
Parameters:
- None
Output: The clear button mixin.
## a11y-card-link
Type: mixin
Source: scss/mixin/_utilities.scss:101
More accessible card linking.
Parameters:
- link (string): The link element's selector.
- at-root (boolean): Whether to use @at-root.
Output: The a11y card link mixin.
## word-wrap
Type: mixin
Source: scss/mixin/_utilities.scss:127
Break long string.
Parameters:
- None
Output: The word-wrap mixin.
## short-ring
Type: mixin
Source: scss/mixin/_utilities.scss:139
Generate a focus ring.
Parameters:
- type (string): The type of the focus ring.
- btn-type (string): The type - hence color - of the button.
Output: The focus ring mixin.
## generate-variables
Type: mixin
Source: scss/mixin/_variables.scss:11
Generate CSS custom properties based on a map.
Parameters:
- map (map): The map to generate the CSS custom properties from.
- exclude (list): The list of keys (or a segment of it) to exclude.
- include (list): The list of keys (or a segment of it) to include.
Output: The generated CSS custom properties.