Skip to content

Commit

Permalink
Pail 21 tooltip (#291)
Browse files Browse the repository at this point in the history
changes inside development/docs/c-tooltip.html

* Make sure the tooltip icon is vertically aligned with the text in a
form
* Make sure the tooltip icon is clickable on mobile

---------

Co-authored-by: marcelpirnay <[email protected]>
  • Loading branch information
marcelpirnay and mars2601 authored Oct 2, 2023
1 parent 5ff6f61 commit 47d022e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
6 changes: 5 additions & 1 deletion content/scss/_c-tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* Variables
========================================================================== */

$c-tooltip-bg: rgba(0,0,0,0.65) !default;
$c-tooltip-bg: rgba(0,0,0,0.75) !default;

/* Component
========================================================================== */
Expand All @@ -19,8 +19,12 @@ $c-tooltip-bg: rgba(0,0,0,0.65) !default;
border-radius: 0.4rem;
max-width: 24rem;
z-index: 1;
&-icon{
display: inline-block;
}
}


.c-tooltip--size-m {
min-width: 24rem;
}
Expand Down
7 changes: 6 additions & 1 deletion content/scss/_o-form-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ $o-form-group-label-font-weight: 500 !default;
Group within a form that defines a layout
========================================================================== */



.o-form-group-layout--standard {

.o-form-group {
Expand All @@ -34,9 +36,12 @@ $o-form-group-label-font-weight: 500 !default;
font-weight: $o-form-group-label-font-weight;
display: block;
flex: none;
.c-tooltip-icon{
margin-left: .4rem;
}
}

.o-form-group__label--with-helper {
label.o-form-group__label--with-helper {
display: flex;
align-items: center;
}
Expand Down
7 changes: 7 additions & 0 deletions content/templates/_components/c-tooltip/05-c-tooltip-icon.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
div(style="padding-bottom: 3.2rem;")
span(class="c-tooltip-icon" data-tooltip="tooltip-5" data-tooltip-placement="top")
+icon('circle-help')
.c-tooltip#tooltip-5(role="tooltip")
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
.c-tooltip__arrow(data-popper-arrow)

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
div(style="padding-bottom: 3.2rem;")
.o-form-group-layout.o-form-group-layout--standard
.o-form-group
label.o-form-group__label.o-form-group__label--with-helper(for="defaultFormNameId")
| Name
span(class="c-tooltip-icon" data-tooltip="tooltip-6" data-tooltip-placement="top")
+icon('circle-help')
.c-tooltip#tooltip-6(role="tooltip")
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
.c-tooltip__arrow(data-popper-arrow)
.o-form-group__controls
input.c-input(type="email" value="John Doe" id="defaultFormNameId")


0 comments on commit 47d022e

Please sign in to comment.