Skip to contents

Set the color and style of the linked in-text terms and pop-up definitions. Colors should be a valid CSS color string, such as "purple" or "#FF0000".

Usage

glossary_style(
  color = "purple",
  text_decoration = "underline",
  def_bg = "#333",
  def_color = "white"
)

Arguments

color

Text color of the linked term

text_decoration

Style of the linked term; a valid CSS text-decoration string, such as "none", underline" or "red wavy underline"

def_bg

Background color of the definition pop-up

def_color

Text color of the definition pop-up

Value

A CSS style string

Examples

glossary_style("#003366", "underline")
#> <style>
#> a.glossary {
#>   color: #003366;
#>   text-decoration: underline;
#>   cursor: help;
#>   position: relative;
#> }
#> 
#> /* only needed for popup = "click" */
#> /* popup-definition */
#> a.glossary .def {
#>   display: none;
#>   position: absolute;
#>   z-index: 1;
#>   width: 200px;
#>   bottom: 100%;
#>   left: 50%;
#>   margin-left: -100px;
#>   background-color: #333;
#>   color: white;
#>   padding: 5px;
#>   border-radius: 6px;
#> }
#> /* show on click */
#> a.glossary:active .def {
#>   display: inline-block;
#> }
#> /* triangle arrow */
#> a.glossary:active .def::after {
#>   content: ' ';
#>   position: absolute;
#>   top: 100%;
#>   left: 50%;
#>   margin-left: -5px;
#>   border-width: 5px;
#>   border-style: solid;
#>   border-color: #333 transparent transparent transparent;
#> }
#> </style>