Skip to content

Commit

Permalink
colorful-boxes:1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lkoehl committed Dec 25, 2024
1 parent b6c3c7c commit 63b0202
Show file tree
Hide file tree
Showing 18 changed files with 466 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/preview/colorful-boxes/1.4.1/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 lkoehl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
116 changes: 116 additions & 0 deletions packages/preview/colorful-boxes/1.4.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Typst Boxes

**Typst Boxes** is a package for creating colorful and customizable boxes in [Typst](https://github.com/typst/typst). It's perfect for enhancing your documents with visually appealing components.

[➡️ Check out the example project](https://typst.app/project/rp9q3upfc69bPUCbv0BjzX) to see all the boxes in action!

---

## Features

- Colorful boxes in four predefined colors: **black**, **red**, **blue**, and **green**.
- A **slanted headline colorbox** for dynamic designs.
- A **simple outline box** for clean layouts.
- A **rotateable sticky note** for fun or informal content.

---

## Examples and Usage

### Colorbox

![colorbox_example](examples/colorbox.png)

A versatile colorful box with a title and customizable design.

#### Code:

```typst
#colorbox(
title: lorem(5),
color: "blue",
radius: 2pt,
width: auto
)[
#lorem(50)
]
```

### Slanted Colorbox

![slantedColorbox_example](examples/slanted-colorbox.png)

Add some flair with a slanted headline.

#### Code

```typst
#slanted-colorbox(
title: lorem(5),
color: "red",
radius: 0pt,
width: auto
)[
#lorem(50)
]
```

### Outline Colorbox

![outlinebox_example](examples/outline-colorbox.png)

A clean and simple box with an outline. Titles can be aligned to the center or the left.

#### Code

```typst
#outline-colorbox(
title: lorem(5),
width: auto,
radius: 2pt,
centering: false
)[
#lorem(50)
]
#outline-colorbox(
title: lorem(5),
color: "green",
width: auto,
radius: 2pt,
centering: true
)[
#lorem(50)
]
```

### Stickybox

![stickybox](examples/stickybox.png)

A fun and rotateable sticky note for informal or highlight content.

#### Code

```typst
#stickybox(
rotation: 5deg,
width: 5cm
)[
#lorem(20)
]
```

## Contributing

We welcome contributions to improve this package! Here's how you can help:

1. Fork the repository.
2. Create a new branch for your feature or fix.
3. Submit a pull request with a clear description.

## License

This project is licensed under the **MIT License**.

You are free to use, modify, and distribute this project under the terms of the license. See the [LICENSE](LICENSE) file for detailed information.
18 changes: 18 additions & 0 deletions packages/preview/colorful-boxes/1.4.1/background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/preview/colorful-boxes/1.4.1/examples/colorbox.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import "../lib.typ": colorbox

Check warning on line 1 in packages/preview/colorful-boxes/1.4.1/examples/colorbox.typ

View check run for this annotation

Typst package check / @preview/colorful-boxes:1.4.1

packages/preview/colorful-boxes/1.4.1/examples/colorbox.typ#L1

This import should use the package specification, not a relative path.

#set page(paper: "a4", margin: 0.5cm, height: auto)

#colorbox(title: lorem(5), color: "blue")[
#lorem(50)
]
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#import "../lib.typ": outline-colorbox

Check warning on line 1 in packages/preview/colorful-boxes/1.4.1/examples/outline-colorbox.typ

View check run for this annotation

Typst package check / @preview/colorful-boxes:1.4.1

packages/preview/colorful-boxes/1.4.1/examples/outline-colorbox.typ#L1

This import should use the package specification, not a relative path.

#set page(paper: "a4", margin: 0.5cm, height: auto)

#outline-colorbox(title: lorem(5), color: "gray")[
#lorem(50)
]

#outline-colorbox(title: lorem(5), centering: true, color: "green")[
#lorem(50)
]
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import "../lib.typ": slanted-colorbox

Check warning on line 1 in packages/preview/colorful-boxes/1.4.1/examples/slanted-colorbox.typ

View check run for this annotation

Typst package check / @preview/colorful-boxes:1.4.1

packages/preview/colorful-boxes/1.4.1/examples/slanted-colorbox.typ#L1

This import should use the package specification, not a relative path.

#set page(paper: "a4", margin: 0.5cm, height: auto)

#slanted-colorbox(title: lorem(5), color: "sand")[
#lorem(50)
]
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/preview/colorful-boxes/1.4.1/examples/stickybox.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import "../lib.typ": stickybox

Check warning on line 1 in packages/preview/colorful-boxes/1.4.1/examples/stickybox.typ

View check run for this annotation

Typst package check / @preview/colorful-boxes:1.4.1

packages/preview/colorful-boxes/1.4.1/examples/stickybox.typ#L1

This import should use the package specification, not a relative path.

#set page(width: auto, margin: 0.5cm, height: auto)

#stickybox(width: 5cm, rotation: 5deg)[
#lorem(20)
]
Loading

0 comments on commit 63b0202

Please sign in to comment.