Skip to content

Commit cd6af03

Browse files
authored
Merge pull request #349 from patternfly/docs-docs-docs
move docs into monorepo
2 parents bdbf4ab + 9d08131 commit cd6af03

File tree

349 files changed

+39641
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+39641
-25
lines changed

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public

docs/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# PatternFly Elements Documentation
2+
3+
Welcome to the main repository for our documentation!
4+
5+
We're using [Hugo](https://gohugo.io/), a static HTML and CSS website generator, and Github Pages.
6+
7+
8+
## Quick-start
9+
Install Hugo, build, and watch for files locally.
10+
11+
### Install Hugo with homebrew
12+
```
13+
brew install hugo
14+
```
15+
16+
### Build your static assets
17+
```
18+
hugo
19+
```
20+
21+
### Watch for files locally
22+
```
23+
hugo server -D
24+
```
25+
26+
27+
## Scripts
28+
29+
### Deploy!
30+
Build and pull in any updates before running the deploy script.
31+
```
32+
./deploy.sh
33+
```

docs/archetypes/default.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
date: {{ .Date }}
4+
draft: true
5+
---
6+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "functions/functions";
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// Although these aren't used quite yet, we'll leave them here so they're stubbed out.
3+
//
4+
@import "maps/block-color-map";
5+
@import "maps/copy-color-map";
6+
@import "maps/form-color-map";
7+
@import "maps/icon-color-map";
8+
@import "maps/link-color-map";
9+
@import "maps/table-color-map";
10+
@import "maps/title-color-map";
11+
12+
// Use function 'map-collect' to merge all maps
13+
// This needs to be located here in order to avoid
14+
// variable issues.
15+
$pfe-global--color-map: map-collect(
16+
$pfe-global--color-map--block,
17+
$pfe-global--color-map--copy,
18+
$pfe-global--color-map--form,
19+
$pfe-global--color-map--icon,
20+
$pfe-global--color-map--link,
21+
$pfe-global--color-map--table,
22+
$pfe-global--color-map--title
23+
);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import "mixins/copy-mixins";
2+
@import "mixins/mixins";
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import "variables/pf-colors";
2+
@import "variables/colors";
3+
@import "variables/typography";
4+
@import "variables/layout";
5+
@import "variables/style";
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
@function pfe-strip-unit($num) {
2+
@return $num / ($num * 0 + 1);
3+
}
4+
5+
@function pfe-size-pem($pxval, $base: $pfe-global--font-size-root) {
6+
@return pfe-strip-unit($pxval) / $base * 1em;
7+
}
8+
9+
@function pfe-size-prem($pxval, $base: $pfe-global--font-size-root) {
10+
@return pfe-strip-unit($pxval) / $base * 1rem;
11+
}
12+
13+
/// Map deep get
14+
/// @author Hugo Giraudel
15+
/// @access public
16+
/// @param {Map} $map - Map
17+
/// @param {Arglist} $keys - Key chain
18+
/// @return {*} - Desired value
19+
@function map-deep-get($map, $keys...) {
20+
@each $key in $keys {
21+
@if type-of($map) == "map" {
22+
$map: map-get($map, $key);
23+
}
24+
@else {
25+
@warn "Map provided is not a map."
26+
}
27+
}
28+
@return $map;
29+
}
30+
31+
// Collect all maps and merge them together
32+
@function map-collect($maps...) {
33+
$collection: ();
34+
@each $map in $maps {
35+
$collection: map-merge($collection, $map);
36+
}
37+
@return $collection;
38+
}
39+
40+
// New color function to only return theme colors
41+
@function color( $name, $theme: "light", $opacity: 1 ) {
42+
$map: map-get($color-map, $name);
43+
$error: false;
44+
$color: null;
45+
@if $map != null {
46+
$color: map-get($map, $theme);
47+
}
48+
@else {
49+
$error: true;
50+
}
51+
@if type-of($color) == color {
52+
@if $opacity == 1 {
53+
@return $color;
54+
}
55+
@if $opacity < 1 {
56+
@return rgba( $color, $opacity );
57+
}
58+
}
59+
@else {
60+
$error: true;
61+
}
62+
@if $error {
63+
@warn "#{$name} is not a valid color";
64+
}
65+
}
66+
67+
// https://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/
68+
// Get the first item in a list
69+
@function first($list) {
70+
@return nth($list, 1);
71+
}
72+
73+
// Get the last item in a list
74+
@function last($list) {
75+
@return nth($list, length($list));
76+
}
77+
78+
@function str-replace($string, $search, $replace: "") {
79+
@if type-of($string) == "string" and type-of($search) == "string" {
80+
$index: str-index($string, $search);
81+
@if $index {
82+
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
83+
}
84+
}
85+
@return $string;
86+
}
87+
88+
@function str-split($string, $separator) {
89+
// empty array/list
90+
$split-arr: ();
91+
// first index of separator in string
92+
$index: str-index("#{$string}", $separator);
93+
// loop through string
94+
@while $index != null {
95+
// get the substring from the first character to the separator
96+
$item: str-slice($string, 1, $index - 1);
97+
// push item to array
98+
$split-arr: append($split-arr, $item);
99+
// remove item and separator from string
100+
$string: str-slice($string, $index + 1);
101+
// find new index of separator
102+
$index: str-index($string, $separator);
103+
}
104+
// add the remaining string to list (the last item) and return
105+
@return append($split-arr, $string);
106+
}
107+
108+
// https://github.com/HugoGiraudel/SassyStrings/blob/master/dist/_SassyStrings.scss
109+
/// Check whether `$string` stars with `$needle`.
110+
/// @param {String} $string - string to check
111+
/// @param {String} $needle - substring to check
112+
/// @return {Bool}
113+
@function str-starts-with($string, $needle) {
114+
@return str-slice($string, 1, str-length($needle)) == $needle;
115+
}
116+
117+
// https://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/#removing-values-from-list
118+
@function remove($list, $value, $recursive: false) {
119+
$result: ();
120+
@for $i from 1 through length($list) {
121+
@if type-of(nth($list, $i)) == list and $recursive {
122+
$result: append($result, remove(nth($list, $i), $value, $recursive));
123+
}
124+
@else if nth($list, $i) != $value {
125+
$result: append($result, nth($list, $i));
126+
}
127+
}
128+
@return $result;
129+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$pfe-global--color-map--block: (
2+
band-background: (
3+
white: $pfe-global--color--white,
4+
black: $pfe-global--color--black,
5+
black-soft: $pfe-global--color--black-soft,
6+
red: $pfe-global--color--red,
7+
red-dark: $pfe-global--color--red-brick,
8+
gray: $pfe-global--color--gray-platinum,
9+
light: $pfe-global--color--gray-platinum,
10+
navy: $pfe-global--color--blue-navy,
11+
blue: $pfe-global--color--blue-peacock,
12+
blue-dark: $pfe-global--color--blue-rain,
13+
charcoal: $pfe-global--color--gray-charcoal
14+
)
15+
);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
$pfe-global--color-map--copy: (
2+
default-paragraph: (
3+
dark: $pfe-global--text-color--inverted,
4+
dark-subtle: $pfe-global--text-color--inverted,
5+
dark-desaturated: $pfe-global--text-color--inverted,
6+
light: $pfe-global--text-color,
7+
subtle: $pfe-global--text-color,
8+
light-subtle: $pfe-global--text-color,
9+
)
10+
);

0 commit comments

Comments
 (0)