add inline color block (#39)

This commit is contained in:
Sven Vogel 2024-08-12 18:07:44 +02:00
parent a4e6e6c47a
commit 08a6eaf79f
2 changed files with 21 additions and 5 deletions

View File

@ -7,7 +7,7 @@
// Edited: 27.06.2024 // Edited: 27.06.2024
// License: MIT // License: MIT
#import "conf.typ": validate-config #import "conf.typ": validate-config, default-config
#import "branding.typ": * #import "branding.typ": *
#import "style.typ": global_styled_doc, content_styled, end_styled #import "style.typ": global_styled_doc, content_styled, end_styled
#import "glossary.typ": glossary #import "glossary.typ": glossary
@ -24,6 +24,21 @@
[#pagebreak()] [#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 // start of template pages and styles
#let dhbw-template(config, body) = [ #let dhbw-template(config, body) = [
#let config = validate-config(config) #let config = validate-config(config)

View File

@ -82,6 +82,7 @@ $
#pagebreak() #pagebreak()
#lorem(100) #lorem(100)
#inline-color("#ff0000", "red")
#figure( #figure(
```rust ```rust