- SCSS 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| abstracts | ||
| elements | ||
| generic | ||
| layouts | ||
| modules | ||
| placeholders | ||
| settings | ||
| .gitignore | ||
| _flower.scss | ||
| _flower_unlayered.scss | ||
| _hippie.scss | ||
| _hippie_unlayered.scss | ||
| KEYWORDS.md | ||
| LICENSE.md | ||
| README.md | ||
HIPPIE styles
Collection of CSS styles, mainly for the use with HIPPIE, written in Sass language.
Getting Started
These instructions will get you a copy of the project up and running on your local machine.
Prerequisites
All styles in this project are written in the Sass language. So a preprocessor may be needed to form Cascading Style Sheets (CSS).
Please choose a implementation suitable for your needs from the Install Sass document.
For example in a Node.js environment you can install Sass with the Node package manager:
npm install -g sass
Or get a dart-sass package and follow the instructions given: https://github.com/sass/dart-sass/releases.
Installing
Clone the repository https://quelltext.interaktionsweise.de/interaktionsweise/hippie-style.git to a folder to get all
source files.
To include HIPPIE styles to a Sass workflow, just import the main file at the appropriate position. Usually this would be at the beginning of your stylesheet:
@use "hippie/hippie";
To use only the core of HIPPIE, the generic rules and the elements without modules and layouts, use basic instead:
@use "hippie/flower";
Both can be configured with the settings from settings/_config.scss:
@use "hippie/hippie" with ($color_back_basic: #fafafa);
It is also possible to link to the resulting CSS file. First the file needs to be compiled sass hippie/_hippie.scss stylesheets/hippie.css. Now the stylesheet can be included into the HTML document
<link href="stylesheets/hippie.css" rel="stylesheet" type="text/css"/>.
Structure
Styles are divided into groups, each in its own folder. The groups differ in whether and where they produce CSS:
| Folder | Content | Produces CSS |
|---|---|---|
settings/ |
Configuration with default values | No |
abstracts/ |
Functions and mixins | No |
placeholders/ |
Placeholders for @extend |
Only when extended |
generic/ |
Global rules not bound to an element | Yes |
elements/ |
Rules for the HTML elements | Yes |
modules/ |
Components and contexts building on the elements | Yes |
layouts/ |
Rule sets for specific designs or whole pages, using all previous parts | Yes |
Settings hold every value meant to be adjusted for a project, like colors, sizes, fonts and breakpoints. All of them
are !default and can be changed with @use "hippie/hippie" with (...).
Abstracts are functions and mixins, e.g. basic_color() or media_up(). Using them adds their result where they
are used, never somewhere else.
Placeholders produce no CSS until something extends them. Then the extending selector is added to the placeholder's
rule, at the position where the placeholder is defined. That position affects the cascade, which is why placeholders are
a group of their own and are loaded before all rules. This folder holds the placeholders shared across groups, like
%basic or %flex_inline. Placeholders that define a keyword, like %button or %status, stay with their element.
Generic rules apply globally without being bound to an element: the focus reset, utility classes like .di_none and
the icon symbols.
Elements follow the HTML living standard, section 4 "The elements of HTML". Each file covers a part of it:
_sections, _grouping, _textlevel (including edits), _embedded, _tables and _interactive (including forms and
scripting). Every element is listed at the top of its file, also when it has no rules. Modifiers of elements follow the
keyword vocabulary in KEYWORDS.md.
Modules add components and contexts, e.g. io for controls, navigation or print.
Layouts are complete rule sets for a specific design or one kind of page.
Entry points
| File | Content |
|---|---|
_hippie.scss |
All groups, rules in the cascade layer hippie |
_basic.scss |
Settings, abstracts, placeholders, generic and elements, rules in the cascade layer hippie |
_hippie_unlayered.scss |
Like _hippie.scss, without a cascade layer |
_basic_unlayered.scss |
Like _basic.scss, without a cascade layer |
The entry points make settings and abstracts available to the project and load everything that produces CSS inside the cascade layer, described in the next section.
Cascade layer
All rules of HIPPIE are placed in the cascade layer hippie. Styles of a page that are not in a layer always override
them, regardless of specificity. A page style therefore only needs to state what differs:
@use "hippie/hippie";
a {
padding: 0; // wins against hippie's `ul.link li a`
}
Declarations with !important behave the other way round: an !important inside the layer wins against an !important
outside of it.
A reset like normalize.css belongs into the sub-layer hippie.reset. Rules directly in the layer hippie always rank
above its sub-layers, so the reset can not override HIPPIE, no matter where it appears in the stylesheet:
@use "sass:meta";
@use "hippie/hippie";
@layer hippie.reset {
@include meta.load-css("vendor/normalize");
}
When linking compiled CSS, the same works with @import url("normalize.css") layer(hippie.reset);.
To place HIPPIE in a layer of your own, load the rules without layer directly, hippie_unlayered or basic_unlayered:
@use "sass:meta";
@layer framework {
@include meta.load-css("hippie/hippie_unlayered");
}
Keywords
Modifier classes like table.blank or a.button follow a shared vocabulary, described in KEYWORDS.md.
Versioning
This project uses simple major steps. A version should always be usable - no guarantees, however. Usually new versions contain many new things and breaking changes. For the versions available, see the tags on this repository.
Authors
Stephan Hagedorn - Initial work - Interaktionsweise
License
This project is licensed under the MIT License - see the LICENSE.md file for details.