Skip to content

Commit 1adb092

Browse files
committed
Minor fixes to wording in manual and created thumbnail
1 parent 2aeab00 commit 1adb092

File tree

7 files changed

+294
-137
lines changed

7 files changed

+294
-137
lines changed

Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ default:
99
# generate manual
1010
doc:
1111
typst compile docs/manual.typ docs/manual.pdf
12-
# typst compile docs/thumbnail.typ thumbnail-light.svg
13-
# typst compile --input theme=dark docs/thumbnail.typ thumbnail-dark.svg
12+
typst compile docs/thumbnail.typ thumbnail-light.svg
13+
typst compile --input theme=dark docs/thumbnail.typ thumbnail-dark.svg
1414

1515
# run test suite
1616
test *args:

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# The `css-colors` Package
2+
<!-- markdownlint-disable MD033 -->
23
<div align="center">Version 0.1.0</div>
34

45
Allows CSS/SVG named colors to be used directly in a Typst document.
@@ -27,7 +28,7 @@ Allows CSS/SVG named colors to be used directly in a Typst document.
2728

2829
## Getting Started
2930

30-
These instructions will get you a copy of the project up and running on the typst web app.
31+
These instructions will get you a copy of the project up and running on the Typst web app.
3132

3233
```typ
3334
#import "@preview/css-colors:0.1.0": *
@@ -37,7 +38,7 @@ Normal text may be #text(fill: css("crimson"))[colored so.]
3738

3839
<picture>
3940
<source media="(prefers-color-scheme: dark)" srcset="./thumbnail-dark.svg">
40-
<img src="./thumbnail-light.svg">
41+
<img src="./thumbnail-light.svg" alt="">
4142
</picture>
4243

4344
## Installation
@@ -82,23 +83,23 @@ just test
8283
8384
Ensure that all tests pass before submitting any changes to maintain the project's integrity.
8485

85-
If you want to test the module with a typst file, you can install the `css-colors` package locally in the `preview` location by running:
86+
If you want to test the module with a Typst file, you can install the `css-colors` package locally in the `preview` location by running:
8687

8788
```bash
8889
just install-preview
8990
```
9091

91-
Once installed, you can import the module into your typst file using the following statement:
92+
Once installed, you can import the package into your Typst file using the following statement:
9293

9394
```typ
9495
#import "@preview/css-colors:0.1.0": *
9596
```
9697

97-
This setup allows you to experiment with the module in a typst file before finalizing your changes.
98+
This setup allows you to experiment with the module in a Typst file before finalizing your changes.
9899

99100
## Usage
100101

101-
Here are some examples demonstrating how to use the `css-colors` module:
102+
The following examples demonstrate the usage of the `css-colors` package in various cases:
102103

103104
```typ
104105
#import "@preview/css-colors:0.1.0": *

docs/manual.pdf

5.15 KB
Binary file not shown.

docs/manual.typ

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#set par(spacing: 1.5em)
66

77
//Customize appearance
8-
#show raw: set text(font: "Fira Mono", size: 11pt)
8+
#show raw: set text(font: "Fira Mono", size: 1.2em)
99
#show raw.where(block: true): set block(fill: css("AntiqueWhite"), inset: 1em, radius: 0.5em, width: 100%)
1010
#show link: set text(fill: blue, font: "Source Sans Pro", size: 12pt)
1111
#show ref: set text(fill: blue, font: "Source Sans Pro", size: 12pt)
@@ -36,7 +36,7 @@
3636

3737
// End of setup
3838

39-
= CSS Colors Module
39+
= The `css-colors` Package
4040

4141
== History
4242

@@ -81,9 +81,9 @@ The CSS Level 1 colors introduced in 1996 specified these same sixteen colors, w
8181
=== SVG/CSS colors
8282

8383
Finally, the #link("https://www.w3.org/TR/SVG11/types.html#ColorKeywords")[SVG 1.1 Specification] of 2011 #cite(<SVG11>) and the #link("https://www.w3.org/TR/css-color-3/#html4")[CSS Color Module Level 3] #cite(<CSS3>) of
84-
2022 have standardized on a list of 147 color names, known as the "recognized color keyword names" or the "extended color keywords" respectively. They include the original 16 colors, augmented by `orange`, and additional colors from the X11 set. These colors---common to both the CSS and SVG standards---are referred to as the CSS Colors in this manual and module.
84+
2022 have standardized on a list of 147 color names, known as the "recognized color keyword names" or the "extended color keywords" respectively. They include the original 16 colors, augmented by `orange`, and additional colors from the X11 set. These colors---common to both the CSS and SVG standards---are referred to as the CSS colors in this manual and package.
8585

86-
This standardization aims to provide a consistent color naming scheme across the Web, and has remained relatively stable. It is this set of color names that forms the basis for this module. How the CSS colors were given their rather idiosyncratic names is explained in a lighthearted but factual fashion by Alex Sexton in this #link("https://www.youtube.com/watch?v=HmStJQzclHc")[this You Tube video] #cite(<CSShistory>).
86+
This standardization aims to provide a consistent color naming scheme across the Web, and has remained relatively stable. It is this set of color names that forms the basis for this package. How the CSS colors were given their rather idiosyncratic names is explained in a lighthearted but factual fashion by Alex Sexton in this #link("https://www.youtube.com/watch?v=HmStJQzclHc")[this You Tube video] #cite(<CSShistory>).
8787

8888
There are 147 "recognized CSS color keyword names" all of which are unique. But of these, only 138 have unique Hex values. This means that there are nine pairs of named colors that share the same hex value as shown in @css-colors-sharing-hex-value.
8989

@@ -94,9 +94,9 @@ Typst ships with #link("https://typst.app/docs/reference/visualize/color/#predef
9494
The remaining seventeen colors have identical names, but---with the exception of `white` and `black`---they
9595
have different RGB/Hex values, as shown in @comparison-typst-css-colors.
9696

97-
== Purpose of Module
97+
== Purpose of Package
9898

99-
The CSS Colors Module is a robust convenience which allows #link("https://www.w3.org/TR/css-color-3/#svg-color")[CSS/SVG colors] to be used by their names within a Typst file, rather than by their RGB/Hex codes, which have to be looked up.
99+
The `css-colors` package is a robust convenience which allows #link("https://www.w3.org/TR/css-color-3/#svg-color")[CSS/SVG colors] to be used by their names within a Typst file, rather than by their RGB/Hex codes, which have to be looked up.
100100

101101
== Easy Reference
102102

@@ -108,7 +108,7 @@ You may also view them in a browser by clicking on this #link("https://htmlprevi
108108

109109
=== Function
110110

111-
The CSS Colors Module provides a function `css` defined as:
111+
The `css-colors` package provides a single function `css` defined as:
112112

113113
```typ
114114
css(
@@ -132,9 +132,9 @@ Since the returned value is of type `color`, it can be used with any of Typst's
132132

133133
== Usage
134134

135-
The following examples demonstrate the usage of the CSS colors module in various cases:
135+
The following examples demonstrate the usage of the `css-colors` package in various cases:
136136

137-
+ Coloring text.
137+
+ Coloring text with a CSS color.
138138

139139
```typ
140140
#import "@preview/css-colors:0.1.0": *
@@ -144,7 +144,7 @@ The following examples demonstrate the usage of the CSS colors module in various
144144

145145
Normal text may be #text(fill: css("crimson"))[colored so.]
146146

147-
+ A rectangle may be colored with `fill`.
147+
+ Filling a rectangle with a CSS color.
148148

149149
```typ
150150
#import "@preview/css-colors:0.1.0": *
@@ -154,7 +154,7 @@ The following examples demonstrate the usage of the CSS colors module in various
154154

155155
#rect(width: 100%, height: auto, fill: css("darkorchid"))
156156

157-
+ CSS colors may be specified in either lowercase or CamelCase.
157+
+ CSS color names are case-insensitive so both `saddlebrown` and `SaddleBrown` are valid.
158158

159159
```typ
160160
#import "@preview/css-colors:0.1.0": *
@@ -168,7 +168,7 @@ The following examples demonstrate the usage of the CSS colors module in various
168168

169169
(b) SaddleBrown: #box(width: 30mm, height: 1em, fill: css("SaddleBrown"))
170170

171-
+ The maroon color in Typst differs from the Maroon color defined in CSS, as evidenced by their distinct hex codes. To emphasize this distinction, the CSS `Maroon` is intentionally capitalized with an initial uppercase letter.
171+
+ The maroon color in Typst differs from the Maroon color defined in CSS, as evidenced by their distinct hex codes. To emphasize this distinction, the CSS `Maroon` is intentionally capitalized with an initial uppercase letter.
172172

173173
```typ
174174
#import "@preview/css-colors:0.1.0": *
@@ -211,13 +211,12 @@ The following examples demonstrate the usage of the CSS colors module in various
211211
#polygon.regular(
212212
fill: css("darkgoldenrod").lighten(60%),
213213
stroke: (paint: css("darkgoldenrod"), thickness: 4pt, cap: "round"),
214-
size: 80mm,
214+
size: 60mm,
215215
vertices: 6,
216216
)
217217
]
218218

219-
+ CSS colors may be used to underline text with a line of default thickness. The
220-
thickness of the underline may be changed manually if desired.
219+
+ CSS colors may be used to underline text.
221220

222221
```typ
223222
#import "@preview/css-colors:0.1.0": *
@@ -244,15 +243,15 @@ The following examples demonstrate the usage of the CSS colors module in various
244243
inset: 10pt,
245244
stroke: none,
246245
align: (center + horizon, center + horizon, center + horizon),
247-
table.header([Color Names], [Hex Value], [Swatch]),
246+
table.header([Aliased Color Names], [Hex Value], [Swatch]),
248247
[aqua \ cyan], [`#00ffff`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#00ffff"))],
249248
[darkgray \ darkgrey], [`#a9a9a9`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#a9a9a9"))], [darkslategray \ darkslategrey], [`#2f4f4f`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#2f4f4f"))],
250249
[dimgray \ dimgrey], [`#696969`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#696969"))], [fuchsia \ magenta], [`#ff00ff`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#ff00ff"))],
251250
[gray \ grey], [`#808080`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#808080"))],
252251
[lightgray \ lightgrey], [`#d3d3d3`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#d3d3d3"))], [lightslategray \ lightslategrey], [`#778899`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#778899"))],
253252
[slategray \ slategrey], [`#708090`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#708090"))],
254253
)
255-
], caption: [CSS colors sharing the same hex value],
254+
], caption: [CSS colors sharing the same hex value.],
256255
) <css-colors-sharing-hex-value>
257256

258257
#pagebreak()
@@ -275,7 +274,7 @@ The following examples demonstrate the usage of the CSS colors module in various
275274
[red], [#text(font: "Fira Mono", size: 11pt)[#color.red.to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb(red))], [`#ff0000`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#ff0000"))], [silver], [#text(font: "Fira Mono", size: 11pt)[#color.silver.to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb(silver))], [`#c0c0c0`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#c0c0c0"))],
276275
[teal], [#text(font: "Fira Mono", size: 11pt)[#color.teal.to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb(teal))], [`#008080`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#008080"))], [white], [#text(font: "Fira Mono", size: 11pt)[#color.white.to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb(white))], [`#ffffff`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#ffffff"))], [yellow], [#text(font: "Fira Mono", size: 11pt)[#color.yellow.to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb(yellow))], [`#ffff00`], [#box(width: 1cm, height: 1cm, stroke: black, fill: rgb("#ffff00"))],
277276
)
278-
], caption: [Comparison of Typst and CSS colors],
277+
], caption: [Comparison of Typst and CSS colors.],
279278
) <comparison-typst-css-colors>
280279

281280
#pagebreak()
@@ -392,5 +391,5 @@ The following examples demonstrate the usage of the CSS colors module in various
392391
[violet], [#text(font: "Fira Mono", size: 11pt)[#css("violet").to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: css("violet"))], [#box(width: 5cm, height: 1cm, stroke: none, fill: css("violet"))], [wheat], [#text(font: "Fira Mono", size: 11pt)[#css("wheat").to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: css("wheat"))], [#box(width: 5cm, height: 1cm, stroke: none, fill: css("wheat"))], [white], [#text(font: "Fira Mono", size: 11pt)[#css("white").to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: css("white"))], [#box(width: 5cm, height: 1cm, stroke: none, fill: css("white"))], [whitesmoke], [#text(font: "Fira Mono", size: 11pt)[#css("whitesmoke").to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: css("whitesmoke"))], [#box(width: 5cm, height: 1cm, stroke: none, fill: css("whitesmoke"))],
393392
[yellow], [#text(font: "Fira Mono", size: 11pt)[#css("yellow").to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: css("yellow"))], [#box(width: 5cm, height: 1cm, stroke: none, fill: css("yellow"))], [yellowgreen], [#text(font: "Fira Mono", size: 11pt)[#css("yellowgreen").to-hex()]], [#box(width: 1cm, height: 1cm, stroke: black, fill: css("yellowgreen"))], [#box(width: 5cm, height: 1cm, stroke: none, fill: css("yellowgreen"))],
394393
)
395-
], caption: [Available CSS colors],
394+
], caption: [Available CSS colors.],
396395
) <available-css-colors>

docs/thumbnail.typ

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
#set text(white) if theme == "dark"
88

99
#set text(22pt)
10+
Normal text may be #text(fill: css("crimson"))[colored so.]
1011
#align(center)[_a thumbnail showing the package's output_]

0 commit comments

Comments
 (0)