Shell CSS lib

Developer
Size
43,289 Kb
Views
30,360

How do I make an shell css lib?

This contains the Campaign Monitor Shell CSS library as a Pen so that its functions and variables can be pulled into other Pens and used :). What is a shell css lib? How do you make a shell css lib? This script and codes were developed by Dave on 17 September 2022, Saturday.

Shell CSS lib Previews

Shell CSS lib - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Shell CSS lib</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
</body>
</html>

Shell CSS lib - Script Codes CSS Codes

@charset "UTF-8";
/** * Shell CSS library by Campaign Monitor. * http://shellcss.io * Licensed under MIT (). */
/** * Settings. */
/* ============================================================================ SETTINGS ========================================================================= */
/** * All of Shell's settings (Sass variables). * * The settings are broken into two categories: * * - "Global".....settings for the entire library. * - "Local"......settings for a particular partial. * * N.B. usually "Local" settings exist in their relevant partial but we combine * them for Shell to make them easier to override. It's easier as you can * override all of the settings in the one place—typically in a * "_settings.scss" partial—compared to overriding "Local" settings above * their relevant partial within the master stylesheet, like so: * $shell-apply-osx-font-smoothing: true; $shell-apply-link-transition: false; @import "[library/path]/base"; $shell-grid-gutter: 24; @import "[library/path]/grid"; * * The above set up is more cumbersome to maintain due to "Local" settings * being dispersed throughout the master stylesheet plus the master stylesheet * should only contain Sass partial imports. * * Having all settings together in the same Sass partial makes life easier for * consumers of Shell. * * ---------------------------------------------------------------------------- * * All settings start with a global namespace: `$shell` followed by one * hyphen, like this: * $shell- * * "Global" settings include a letter "g" to easily identify them, like so: * $shell-g- * * "Local" settings include the name of its section to easily identify them, so * settings for the "Base" and "Grid" sections would be formatted like this: * $shell-base- $shell-grid- * * The `$shell` namespace prevents your project settings and Shell's settings * from clashing with each other, and allows you to easily see what is * coming from Shell and what isn't. * * ---------------------------------------------------------------------------- * * CONTENTS: * * 1. Base number (Global) * 2. Colours (Global) * 3. Typography (Global) * 4. Spacing (Global) * 5. Cosmetics (Global) * 6. Breakpoints (Global) * 7. Z-Index system (Global) * 8. HiDPI units (Global) * 9. HTML textual `input`s (Global) * 10. Base (Local) * 11. Container (Local) * 12. Grid (Local) * 13. Helpers (Local) */
/* 1. Base number (Global) ========================================================================= */
/** * The baseline number from which everything else is derived. */
/* 2. Colours (Global) ========================================================================= */
/** * Black and white. */
/** * Base text. */
/** * Links. */
/* 3. Typography (Global) ========================================================================= */
/** * The scale based on `$shell-g-base-number` being 16: * * Decrease: 14, 13, 12 * Increase: 18, 24, 28, 32, 40, 48, 56, 72 */
/** * Line height. */
/** * Families. */
/** * Weights. */
/* 4. Spacing (Global) ========================================================================= */
/** * The scale based on `$shell-g-base-number` being 16: * * Decrease: 12, 8, 4 * Increase: 24, 32, 40, 48, 56, 72, 96 */
/* 5. Cosmetics (Global) ========================================================================= */
/* 6. Breakpoints (Global) ========================================================================= */
/** * The breakdown of the breakpoints is based off this chart: * http://static.lukew.com/unified_device_design.png * * Here's the thinking: * * - Palm..........smart-phones and feature phones—anything that can fit into * the palm of a hand. * - Lap...........typically tablets, notebooks and laptops—anything that is * portable that doesn't include phones. * - Lap small.....smaller tablets/notebooks and e-readers e.g. Kindle. * - Lap large.....larger tablets and laptops. * - Desk..........desktop computers, TVs, etc.—anything that isn't portable. * - Desk large....larger desktop computer monitors, TVs, and who knows what * else? * * The breakpoints: * * - Palm: 0–640px * - Lap: 641px + * - Lap small: 768px + * - Lap large: 901px + * - Desk: 1200px + * - Desk large: 1366px + * * @credit * http://www.lukew.com/ff/entry.asp?1679 */
/** * All the breakpoints divided by the default user-agent font-size setting * that is non-overridable by Shell's base font size setting: * `$shell-g-font-size`. We do this division as all viewport width and height * media queries are to be applied with the `em` unit. See: * http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/. * * N.B. if you wish to override any of the breakpoints then don't forget to * apply this calculation: * ([breakpoint-value] / 16) * 1em * * N.B. as we're using a Sass map we need to use a Sass function to make it * easier to apply the map keys, the function lives in * "Mixins/Functions -> Retrieve from maps". */
/** * The setting used for the default breakpoint applied to the * "Mixins/Functions -> Apply at breakpoints" mixin. */
/* 7. Z-Index system (Global) ========================================================================= */
/** * A nice system that uses Sass maps to keep your project `z-index`s * maintainable, sane, and free of those crazy `z-index: 99999;` occurrences! * * Be sure to read this to fully understand how the system works: * http://www.sitepoint.com/better-solution-managing-z-index-sass/ * * Shell kicks it off by providing a standard stacking order that most projects * would require, you can then update the Sass map in your project "Settings" * partial, be sure to use nested maps to make this system aware of stacking * contexts as having a flat map will soon become a headache to maintain. * * Applying `z-index`s with this system is done like this: * .c-header { z-index: z(header); } * * And for nested stacking contexts (defined via a nested map): * .c-dialog__close-button { z-index: z(dialog-elements, close-button); } * * N.B. as we're using a Sass map (and nested maps) we need to use a Sass * function to make it easier to apply the map keys and to be able to * retrieve nested map keys. The function lives in * "Mixins/Functions -> Retrieve from maps". * * @credit * http://www.sitepoint.com/better-solution-managing-z-index-sass/ */
/** * Starting from highest to lowest: *