Skip to contents

Create the CSS for a striped border on each book page

Usage

stripes(
  colors = c(pink = "#983E82", orange = "#E2A458", yellow = "#F5DC70", green = "#59935B",
    blue = "#467AAC", purple = "#61589C"),
  height = 3
)

Arguments

colors

a named vector of the colours, the names are the alias and the values are the colour (in any CSS format, such as hex)

height

the height of each stripe in pixels

Value

a character string of the CSS

Examples

# default PsyTeachR colours
stripes()
#> /* named colours */
#> :root {
#>   --pink: #983E82;
#>   --orange: #E2A458;
#>   --yellow: #F5DC70;
#>   --green: #59935B;
#>   --blue: #467AAC;
#>   --purple: #61589C;
#> }
#> 
#> /* rainbow borders */
#> body {
#>   margin-top: 18px;
#>   box-shadow:
#>     0 -3px 0 0px var(--purple),
#>     0 -6px 0 0px var(--blue),
#>     0 -9px 0 0px var(--green),
#>     0 -12px 0 0px var(--yellow),
#>     0 -15px 0 0px var(--orange),
#>     0 -18px 0 0px var(--pink);
#> }

# red, yellow and blue thick stripes
stripes(c(red = "red", yellow = "yellow", blue = "blue"), 10)
#> /* named colours */
#> :root {
#>   --red: red;
#>   --yellow: yellow;
#>   --blue: blue;
#> }
#> 
#> /* rainbow borders */
#> body {
#>   margin-top: 30px;
#>   box-shadow:
#>     0 -10px 0 0px var(--blue),
#>     0 -20px 0 0px var(--yellow),
#>     0 -30px 0 0px var(--red);
#> }