-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a7a362
commit 74cdc8c
Showing
3 changed files
with
98 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { BaseStyle } from 'primeng/base'; | ||
|
||
const theme = ({ dt }) => ` | ||
.p-tooltip { | ||
position: absolute; | ||
display: none; | ||
max-width: ${dt('tooltip.max.width')}; | ||
} | ||
.p-tooltip-right, | ||
.p-tooltip-left { | ||
padding: 0 ${dt('tooltip.gutter')}; | ||
} | ||
.p-tooltip-top, | ||
.p-tooltip-bottom { | ||
padding: ${dt('tooltip.gutter')} 0; | ||
} | ||
.p-tooltip-text { | ||
white-space: pre-line; | ||
word-break: break-word; | ||
background: ${dt('tooltip.background')}; | ||
color: ${dt('tooltip.color')}; | ||
padding: ${dt('tooltip.padding')}; | ||
box-shadow: ${dt('tooltip.shadow')}; | ||
border-radius: ${dt('tooltip.border.radius')}; | ||
} | ||
.p-tooltip-arrow { | ||
position: absolute; | ||
width: 0; | ||
height: 0; | ||
border-color: transparent; | ||
border-style: solid; | ||
scale: 2; | ||
} | ||
.p-tooltip-right .p-tooltip-arrow { | ||
margin-top: calc(-1 * ${dt('tooltip.gutter')}); | ||
border-width: ${dt('tooltip.gutter')} ${dt('tooltip.gutter')} ${dt('tooltip.gutter')} 0; | ||
border-right-color: ${dt('tooltip.background')}; | ||
} | ||
.p-tooltip-left .p-tooltip-arrow { | ||
margin-top: calc(-1 * ${dt('tooltip.gutter')}); | ||
border-width: ${dt('tooltip.gutter')} 0 ${dt('tooltip.gutter')} ${dt('tooltip.gutter')}; | ||
border-left-color: ${dt('tooltip.background')}; | ||
} | ||
.p-tooltip-top .p-tooltip-arrow { | ||
margin-left: calc(-1 * ${dt('tooltip.gutter')}); | ||
border-width: ${dt('tooltip.gutter')} ${dt('tooltip.gutter')} 0 ${dt('tooltip.gutter')}; | ||
border-top-color: ${dt('tooltip.background')}; | ||
border-bottom-color: ${dt('tooltip.background')}; | ||
} | ||
.p-tooltip-bottom .p-tooltip-arrow { | ||
margin-left: calc(-1 * ${dt('tooltip.gutter')}); | ||
border-width: 0 ${dt('tooltip.gutter')} ${dt('tooltip.gutter')} ${dt('tooltip.gutter')}; | ||
border-top-color: ${dt('tooltip.background')}; | ||
border-bottom-color: ${dt('tooltip.background')}; | ||
} | ||
`; | ||
|
||
const classes = { | ||
root: 'p-tooltip p-component', | ||
arrow: 'p-tooltip-arrow', | ||
text: 'p-tooltip-text' | ||
}; | ||
|
||
@Injectable() | ||
export class TooltipStyle extends BaseStyle { | ||
name = 'tooltip'; | ||
|
||
theme = theme; | ||
|
||
classes = classes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters