|
1 | | -## Theming Catalog |
2 | | - |
3 | | -### `logoSrc` |
4 | | - |
5 | | -`string` |
6 | | - |
7 | | -Path to a logo image file which will be placed in the top-left corner. |
8 | | - |
9 | | -### `theme` |
10 | | - |
11 | | -`Object` |
12 | | - |
13 | | -Object which describes which colors, fonts and font sizes to use. |
14 | | - |
15 | | -```code |
16 | | -… |
17 | | -title: 'Catalog', |
18 | | -theme: { |
19 | | - <theme configuration here…> |
20 | | -} |
21 | | -… |
| 1 | +> Catalog offers a few ways to customize the appearance to match your project. All of the customization options below can be made by changing the attributes of the `Catalog` component in `index.js`. |
| 2 | +
|
| 3 | +## Logo |
| 4 | +You can add a plain text title or logo image to the header section of the sidebar. To use text, change the `title` attribute and if you’d like to use an image, add the URL of the image to the `logoSrc`. |
| 5 | + |
| 6 | +- `title` (`string`) |
| 7 | +- `logoSrc` (`string`) |
| 8 | + |
| 9 | + |
| 10 | +## Theme |
| 11 | +The visual design of the user interface of Catalog is customizable. Simply add a `theme` attribute to the `Catalog` component in `index.js` and override the default values below with your custom CSS definitions. |
| 12 | + |
| 13 | +- `theme` (`object`) |
| 14 | + |
| 15 | +### Base Typography |
| 16 | +```table |
| 17 | +rows: |
| 18 | + - Attribute: '`baseFontSize`' |
| 19 | + Default: '`16`' |
| 20 | + Application: Base font size. |
| 21 | + - Attribute: '`msRatio`' |
| 22 | + Default: '`1.2`' |
| 23 | + Application: Modular scale ratio for font sizes. |
| 24 | + - Attribute: '`fontFamily`' |
| 25 | + Default: '`Roboto, sans-serif`' |
| 26 | + Application: Font family of the body text. |
| 27 | + - Attribute: '`fontHeading`' |
| 28 | + Default: '`Roboto, sans-serif`' |
| 29 | + Application: Font family of the headings. |
| 30 | + - Attribute: '`fontMono`' |
| 31 | + Default: '`Source Code Pro, monospace`' |
| 32 | + Application: Font family of the code text. |
22 | 33 | ``` |
23 | 34 |
|
24 | | -#### `fontFamily` / `fontHeading` / `fontMono` |
25 | | - |
26 | | -The name (including any fallback fonts) of the font for copy text, headings and pre/code blocks. |
27 | | - |
28 | | -#### `baseFontSize` / `msRatio` |
29 | | - |
30 | | -The font size is derived from these two values. Default is 16px / 1.2. See [modularscale](http://www.modularscale.com/?16&px&1.2&web&text). |
31 | | - |
32 | | -#### Colors |
33 | | - |
34 | | -The [src/DefaultTheme.js](https://github.com/interactivethings/catalog/blob/master/src/DefaultTheme.js) file contains all colors which you can set. |
35 | | - |
36 | | -##### `background`, `textColor`, `codeColor`, `linkColor` |
37 | | - |
38 | | -The primary foreground and background colors. |
39 | | - |
40 | | -##### `lightColor` |
41 | | - |
42 | | -Used as a foreground or border color. |
43 | | - |
44 | | -##### `pageHeading{Background,TextColor,Height}` |
45 | | - |
46 | | -Used in PageHeader. `pageHeadingHeight` is not a color but the height of the |
47 | | -whole PageHeader component. |
48 | | - |
49 | | -##### `navBar{Background,TextColor}` |
50 | | - |
51 | | -Used in the navigation bar. |
52 | | - |
53 | | -##### `brandColor` |
54 | | - |
55 | | -ResponsiveTabs (tab text), Download specimen (title text). |
56 | | -Typography: headings. |
| 35 | +### Base Colors |
| 36 | +```table |
| 37 | +rows: |
| 38 | + - Attribute: '`brandColor`' |
| 39 | + Default: '`#003B5C`' |
| 40 | + Application: Accent color used for headings |
| 41 | + - Attribute: '`textColor`' |
| 42 | + Default: '`#333333`' |
| 43 | + Application: Font color of the text in the main column. |
| 44 | + - Attribute: '`codeColor`' |
| 45 | + Default: '`#00263E`' |
| 46 | + Application: Font color of the code in the main column. |
| 47 | + - Attribute: '`linkColor`' |
| 48 | + Default: '`#FF5555`' |
| 49 | + Application: Font color of links in the main column. |
| 50 | + - Attribute: '`lightColor`' |
| 51 | + Default: '`#D6D6D6`' |
| 52 | + Application: Border color used for blockquotes in main column. |
| 53 | +``` |
57 | 54 |
|
58 | | -##### `sidebarColor{,Text,TextActive,Line,Heading}` |
| 55 | +### Page Header |
| 56 | +```table |
| 57 | +rows: |
| 58 | + - Attribute: '`pageHeadingBackground`' |
| 59 | + Default: '`#003B5C`' |
| 60 | + Application: Background color of the header in the main column. |
| 61 | + - Attribute: '`pageHeadingTextColor`' |
| 62 | + Default: '`#FFFFFF`' |
| 63 | + Application: Font color of the header in the main column. |
| 64 | + - Attribute: '`pageHeadingHeight`' |
| 65 | + Default: '`200`' |
| 66 | + Application: Height of the header in the main column and sidebar. |
| 67 | +``` |
59 | 68 |
|
60 | | -Used in the sidebar. |
| 69 | +### Main Column |
| 70 | + |
| 71 | +```table |
| 72 | +rows: |
| 73 | + - Attribute: '`background`' |
| 74 | + Default: '`#F9F9F9`' |
| 75 | + Application: Background color of the body in main column. |
| 76 | + - Attribute: '`bgLight`' |
| 77 | + Default: '`#F2F2F2`' |
| 78 | + Application: Background color of light specimens. |
| 79 | + - Attribute: '`bgDark`' |
| 80 | + Default: '`#333333`' |
| 81 | + Application: Background color of dark specimens. |
| 82 | +``` |
61 | 83 |
|
62 | | -##### `bg{Light,Dark}`, `checkerboardPattern{Light,Dark}` |
| 84 | +### Sidebar |
| 85 | +```table |
| 86 | +rows: |
| 87 | + - Attribute: '`sidebarColor`' |
| 88 | + Default: '`#FFFFFF`' |
| 89 | + Application: Background color of the body in sidebar column. |
| 90 | + - Attribute: '`sidebarColorLine`' |
| 91 | + Default: '`#EBEBEB`' |
| 92 | + Application: Border color of the links in sidebar column. |
| 93 | + - Attribute: '`sidebarColorHeading`' |
| 94 | + Default: '`#003B5C`' |
| 95 | + Application: Font color of the header in the sidebar column. |
| 96 | + - Attribute: '`sidebarColorText`' |
| 97 | + Default: '`#003B5C`' |
| 98 | + Application: Font color of the list items in the sidebar column. |
| 99 | + - Attribute: '`sidebarColorTextActive`' |
| 100 | + Default: '`#FF5555`' |
| 101 | + Application: Font color of the active list item in the sidebar column. |
| 102 | +``` |
63 | 103 |
|
64 | | -Background colors and patterns for html, react, and image specimens. |
| 104 | +### Navigation Bar |
| 105 | +```table |
| 106 | +rows: |
| 107 | + - Attribute: '`navBarBackground`' |
| 108 | + Default: '`#F2F2F2`' |
| 109 | + Application: Background color of the navigation bar at the bottom of the main column. |
| 110 | + - Attribute: '`navBarTextColor`' |
| 111 | + Default: '`#003B5C`' |
| 112 | + Application: Font color of the navigation bar at the bottom of the main column. |
| 113 | +``` |
65 | 114 |
|
66 | | -##### `codeStyles` |
| 115 | +### Code Syntax Styles |
| 116 | +The code syntax highlighting is based on based on [PrismJS](http://prismjs.com/) and can be adjusted with `codeStyles`. |
67 | 117 |
|
68 | | -Map from [PrismJS](http://prismjs.com/) token type to style object. Example: |
| 118 | +- `codeStyles` (`object`) |
69 | 119 |
|
| 120 | +Example: |
70 | 121 | ```code |
71 | 122 | codeStyles: { |
72 | 123 | tag: {color: '#FF5555', fontWeight: 'bold'} |
|
0 commit comments