Skip to content

Commit d4e6313

Browse files
committed
Reconciling documentation differences from Style Guide
1 parent dc3ab87 commit d4e6313

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

modules/primer-popover/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,36 @@ title: Popover
4040
status: Experimental
4141
-->
4242

43+
Popovers are used to bring attention to specific user interface elements, typically to suggest an action or to guide users through a new experience. They consist of:
44+
45+
- The block element, `.Popover`, which simply positions its content absolutely atop other body content.
46+
- The child element, `.Popover-message`, which contains the markup for the intended messaging and the visual "caret."
47+
48+
In the examples below, `Popover-message`, in particular, uses a handful of utility classes to style it appropriately. And these are intended to demonstrate the default, go-to presentation for the popover's message. By default, the message's caret is centered on the top edge of the message.
49+
50+
The `Popover-message` element also supports several modifiers, most of which position the caret differently:
51+
52+
- `.Popover-message--top` (default): Places the caret on the top edge of the message, horizontally centered.
53+
- `.Popover-message--bottom`: Places the caret on the bottom edge of the message, horizontally centered.
54+
- `.Popover-message--right`: Places the caret on the right edge of the message, vertically centered.
55+
- `.Popover-message--left`: Places the caret on the left edge of the message, vertically centered.
56+
57+
Each of these modifiers also support a syntax for adjusting the positioning the caret to the right, left, top, or bottom of its respective edge. That syntax looks like:
58+
59+
- `.Popover-message--top--right`
60+
- `.Popover-message--right--top`
61+
- `.Popover-message--bottom--left`
62+
- `.Popover-message--left--bottom`
63+
64+
Lastly, there is an added `.Popover-message--lg` modifer, which Assumes a slightly wider popover message.
65+
66+
### Notes
67+
68+
The samples below include optional markup, like:
69+
- An outermost container that establishes stacking context (e.g. `position-relative`).
70+
- A choice piece of user interface (a button, in this case) to relate the popover to.
71+
- Use of the `Details` and `js-details` family of class names, which interact with JavaScript to demonstrate dismissal of the popover by clicking the nested "Got it!" button.
72+
4373
### Basic example
4474
Defaults to caret oriented top-center.
4575

0 commit comments

Comments
 (0)