add inline color block (#39)
This commit is contained in:
parent
a4e6e6c47a
commit
08a6eaf79f
17
src/lib.typ
17
src/lib.typ
|
@ -7,7 +7,7 @@
|
|||
// Edited: 27.06.2024
|
||||
// License: MIT
|
||||
|
||||
#import "conf.typ": validate-config
|
||||
#import "conf.typ": validate-config, default-config
|
||||
#import "branding.typ": *
|
||||
#import "style.typ": global_styled_doc, content_styled, end_styled
|
||||
#import "glossary.typ": glossary
|
||||
|
@ -24,6 +24,21 @@
|
|||
[#pagebreak()]
|
||||
}
|
||||
|
||||
#let inline-color(color, content) = {
|
||||
box(
|
||||
stroke: 1pt + ABB-GRAY-05,
|
||||
radius: 2pt,
|
||||
inset: (left: 2pt, right: 2pt),
|
||||
outset: (top: 4pt, bottom: 4pt),
|
||||
fill: ABB-GRAY-06,
|
||||
[#box(fill: rgb(color), radius: 2pt, inset: 0pt, width: 0.75em, height: 0.75em) #text(
|
||||
font: default-config.style.code.font,
|
||||
size: default-config.style.code.size,
|
||||
content,
|
||||
)],
|
||||
)
|
||||
}
|
||||
|
||||
// start of template pages and styles
|
||||
#let dhbw-template(config, body) = [
|
||||
#let config = validate-config(config)
|
||||
|
|
|
@ -82,6 +82,7 @@ $
|
|||
#pagebreak()
|
||||
|
||||
#lorem(100)
|
||||
#inline-color("#ff0000", "red")
|
||||
|
||||
#figure(
|
||||
```rust
|
||||
|
|
Loading…
Reference in New Issue