|
1 | | -# Primer CSS Breadcrumb Navigation |
| 1 | +# Primer CSS / Popover |
2 | 2 |
|
3 | 3 | [](https://www.npmjs.org/package/primer-popover) |
4 | 4 | [](https://travis-ci.org/primer/primer-css) |
5 | 5 |
|
6 | 6 | > Popover for suggesting, guiding, and bringing attention to specific UI elements on a page. |
7 | 7 |
|
8 | | -This repository is a module of the full [primer-css][primer] repository. |
| 8 | +This repository is a module of the full [primer-css][primer-css] repository. |
| 9 | + |
| 10 | +## Install |
| 11 | + |
| 12 | +This repository is distributed with [npm]. After [installing npm][install-npm], you can install `primer-popover` with this command. |
| 13 | + |
| 14 | +``` |
| 15 | +$ npm install --save primer-popover |
| 16 | +``` |
| 17 | + |
| 18 | +## Usage |
| 19 | + |
| 20 | +The source files included are written in [Sass][sass] (SCSS) You can simply point your sass `include-path` at your `node_modules` directory and import it like this. |
| 21 | + |
| 22 | +```scss |
| 23 | +@import "primer-popover/index.scss"; |
| 24 | +``` |
| 25 | + |
| 26 | +You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._ |
| 27 | + |
| 28 | +## Build |
| 29 | + |
| 30 | +For a compiled **CSS** version of this module, an npm script is included that will output a css version to `build/build.css` The built css file is also included in the npm package: |
| 31 | + |
| 32 | +``` |
| 33 | +$ npm run build |
| 34 | +``` |
9 | 35 |
|
10 | 36 | ## Documentation |
11 | 37 |
|
12 | 38 | <!-- %docs |
13 | 39 | title: Popover |
14 | | -status: Unstable |
| 40 | +status: Experimental |
15 | 41 | --> |
16 | 42 |
|
17 | | -Breadcrumbs are used to show taxonomical context on pages that are many levels deep in a site’s hierarchy. Breadcrumbs show and link to parent, grandparent, and sometimes great-grandparent pages. Breadcrumbs are most appropriate on pages that: |
| 43 | +### Basic example |
| 44 | + |
| 45 | +```html title="Center-aligned" |
| 46 | +<div class="position-relative text-center"> |
| 47 | + <button class="btn btn-primary">UI</button> |
| 48 | + <div class="position-absolute right-0 left-0 text-left"> |
| 49 | + <div class="Popover p-4 mt-2 mx-auto Box box-shadow-large"> |
| 50 | + <h4 class="mb-2">Popover heading</h4> |
| 51 | + <p>Message about this particular piece of UI.</p> |
| 52 | + <button type="submit" class="btn btn-outline mt-2 text-bold">Got it!</button> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | +</div> |
| 56 | +``` |
| 57 | + |
| 58 | +### Right-aligned example |
18 | 59 |
|
19 | | -- Are many levels deep on a site |
20 | | -- Do not have a section-level navigation |
21 | | -- May need the ability to quickly go back to the previous (parent) page |
| 60 | +```html title="Right-aligned" |
| 61 | +<div class="position-relative text-right"> |
| 62 | + <button class="btn btn-primary">UI</button> |
| 63 | + <div class="position-absolute right-0 left-0 text-left"> |
| 64 | + <div class="Popover Popover--right p-4 mt-2 Box box-shadow-large"> |
| 65 | + <h4 class="mb-2">Popover heading</h4> |
| 66 | + <p>Message about this particular piece of UI.</p> |
| 67 | + <button type="submit" class="btn btn-outline mt-2 text-bold">Got it!</button> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | +</div> |
| 71 | +``` |
22 | 72 |
|
23 | | -#### Usage |
| 73 | +### Left-aligned example |
24 | 74 |
|
25 | | -```html title="Popover" |
26 | | -<div class="Popover top-right position-absolute right-0 js-notice p-4 Box"> |
27 | | - <h4 class="mb-2">Popover heading</h4> |
28 | | - <p>Message about this particular piece of UI.</p> |
29 | | - <button type="submit" class="js-notice-dismiss btn btn-outline mt-2 text-bold">Got it!</button> |
| 75 | +```html title="Left-aligned" |
| 76 | +<div class="position-relative"> |
| 77 | + <button class="btn btn-primary">UI</button> |
| 78 | + <div class="position-absolute right-0 left-0 text-left"> |
| 79 | + <div class="Popover Popover--left p-4 mt-2 Box box-shadow-large"> |
| 80 | + <h4 class="mb-2">Popover heading</h4> |
| 81 | + <p>Message about this particular piece of UI.</p> |
| 82 | + <button type="submit" class="btn btn-outline mt-2 text-bold">Got it!</button> |
| 83 | + </div> |
| 84 | + </div> |
30 | 85 | </div> |
31 | 86 | ``` |
32 | 87 |
|
| 88 | +### Large example |
| 89 | + |
| 90 | +```html title="Large" |
| 91 | +<div class="position-relative text-center"> |
| 92 | + <button class="btn btn-primary">UI</button> |
| 93 | + <div class="position-absolute right-0 left-0 text-left"> |
| 94 | + <div class="Popover Popover--lg p-4 mt-2 mx-auto Box box-shadow-large"> |
| 95 | + <h4 class="mb-2">Popover heading</h4> |
| 96 | + <p>Message about this particular piece of UI.</p> |
| 97 | + <button type="submit" class="btn btn-outline mt-2 text-bold">Got it!</button> |
| 98 | + </div> |
| 99 | + </div> |
| 100 | +</div> |
| 101 | +``` |
33 | 102 | <!-- %enddocs --> |
34 | 103 |
|
35 | 104 | ## License |
36 | 105 |
|
37 | | -MIT © [GitHub](https://github.com/) |
| 106 | +[MIT](./LICENSE) © [GitHub](https://github.com/) |
38 | 107 |
|
39 | | -[primer]: https://github.com/primer/primer |
40 | | -[primer-support]: https://github.com/primer/primer-support |
41 | | -[support]: https://github.com/primer/primer-support |
| 108 | +[primer-css]: https://github.com/primer/primer |
42 | 109 | [docs]: http://primercss.io/ |
43 | 110 | [npm]: https://www.npmjs.com/ |
44 | 111 | [install-npm]: https://docs.npmjs.com/getting-started/installing-node |
|
0 commit comments