Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIG-4453: Tooltip Component #762

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions components/base/tooltip/tooltip.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<div class="wrapper">
<div class="wrapper--label">
<label>Default Tool Tip</label>

<!--- START: ToolTip Component --->
<div class="tt">
<div class="icon" />
<div class="msg">
This information is collected to ensure the marriage abides by Massachusetts State Law Chapter 207 Sections 1-8.
</div>
</div>
<!--- END: ToolTip Component --->
</div>
</div>

<br /><br />

<div class="wrapper">
<div class="wrapper--label">
<label>Tool Tip w/`i` icon</label>

<!--- START: ToolTip Component --->
<div class="tt">
<div class="icon tt--info" />
<div class="msg">
This information is collected to ensure the marriage abides by Massachusetts State Law Chapter 207 Sections 1-8.
</div>
</div>
<!--- END: ToolTip Component --->
</div>
</div>
3 changes: 3 additions & 0 deletions components/base/tooltip/tooltip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: ToolTip
handle: tt
status: ready
5 changes: 5 additions & 0 deletions scripts/components/tooltip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'
// This module controls the City of Boston table component
// ---------------------------


92 changes: 92 additions & 0 deletions stylesheets/components/tooltip/_component.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*

ToolTip

Base:
tt

Elements:
c = Container
i = icon
w = Tool Tip Wrapper
*/

.tt
position: relative;
display: inline-block;
margin-left: 0.25em;
padding: 0;

.icon
background: $optimistic-blue-dark
// width: 10px
// height: 10px
// border-radius: 50%
// font-size: 0.5rem

// margin: 5px 0.5em 0 5px
// padding: 4.7px 0 0 3.0px
// line-height: 0px
// color: white

line-height: normal
color: white
font-size: 0.5rem
text-align: center
width: 10px;
height: 10px;
border-radius: 50%

&::before
content: '?'

.tt--info
text-transform: lowercase
&::before { content: 'i' }

.msg
display: none
position: absolute
line-height: normal
z-index: 1000
left: 110%
top: -10%

min-width: 250px
max-width: 300px

padding: 0.25em 0.5em
font-weight: 300
font-style: italic
font-size: 1.875em
text-transform: initial
text-align: left

background: $grey-000
font-family: $serif
color: $grey-400

.icon:hover .msg
display: block


.tt-wrapper {
display: block;
margin-bottom: 1em;
}

.tt-wrapper--label {
display: flex;
flex-start: left;
align-items: center;

label {
display: inline-block;
color: #091f2f;
font-family: "Lora", Georgia, serif;
font-size: 15px;
font-weight: 500;
line-height: 1.4;
letter-spacing: 1px;
}
}
7 changes: 7 additions & 0 deletions stylesheets/components/tooltip/base.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*

SECTION HEADER

*/

@require('*.styl')
1 change: 1 addition & 0 deletions stylesheets/variables/_colors.styl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $grey-000 = #f3f3f3
$grey-100 = #e0e0e0
$grey-200 = #C8C8C8
$grey-300 = #828282
$grey-400 = #58585b

$focus-indicator-color = $optimistic-blue-light
$error-border-color = $freedom-red-light
Expand Down