Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit e6effcb

Browse files
committed
Merge pull request #2 from guideguide/adjust
Rather than offset/width, use a single adjust field
2 parents da54b09 + 91336e2 commit e6effcb

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

README.md

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,14 @@ A fill is represented by a asterisk `*` folowed by nothing and is a gap that wil
170170

171171
## Grid Options
172172

173-
Optional values to modify how the grid is created.
173+
> (<modifiers>, <adjustments>)
174+
175+
Optional values to modify how the grid is created. They are wrapped in parens and broken into two sections separated by a comma.
176+
177+
#### Examples
178+
179+
- `(vfp, ~|~)`
180+
A grid of vertical guides, with "first" remainder distribution, in pixel mode. The grid is centered.
174181

175182
### Orientation
176183

@@ -204,33 +211,50 @@ Determines whether GuideGuide is strict about integers when calculating pixels
204211

205212
- `p` pixel specific
206213

207-
### Grid width
214+
### Grid adjust
215+
216+
> <left offset> | <width> | <right offset>
217+
218+
A string similar to Grid notation that specifies the left and right offsets and width of the grid, separated by pipes (which represent the edges of the grid).
208219

209-
Optional unit object that specifies the width of the grid area to be used for the calculation. Must be a positive value. The width option can be left blank.
220+
Width is defined by enclosing a unit object in pipes. The tilde `~` can be used similarly to the way wildcards are used.
210221

211222
#### Examples:
212223

213-
- `| ~ | ~ | ~ | ( v, 100px )`
214-
A three column grid that is one hundred pixels wide.
224+
- `(v, |100px|)`
225+
A one hundred pixel wide grid.
215226

216-
### Grid offset
227+
- `(v, |~|)`
228+
A full width grid (default)
217229

218-
Optional unit object that specifies how far from the origin the grid will be offset.
230+
Position works similarly to how CSS works. Think of the `~` as "auto". To define the left or right offset, place a `~` or unit object on either side of the pipes.
219231

220-
#### Examples
232+
#### Examples:
233+
234+
- `(v, 20px|100px|)`
235+
A one hundred pixel wide grid, twenty pixels from the left side.
221236

222-
- A ten pixel column that sits 50px from the left side of the document/selection
237+
- `(v, |100px|20px)`
238+
A one hundred pixel wide grid, twenty pixels from the right side.
223239

224-
`| 10px | ( vF, , 50px )`
240+
- `(v, 20px|100px|20px)`
241+
A one hundred pixel wide grid, twenty pixels from the left side (the right offset is ignored if a left and right offset is specified with a defined width).
225242

243+
- `(v, 20px|~|20px)`
244+
A grid with a width that is 40px less than the width of the document, with 20px space on either side.
226245

227-
- A ten pixel column that sits 50px from the right site of the doucment/selection
246+
- `(v, ~|100px|)`
247+
A right aligned, one hundred pixel wide grid.
228248

229-
`| 10px | ( vL, , 50px )`
249+
- `(v, ~|100px|~)`
250+
A centered, one hundred pixel wide grid.
230251

231-
- A ten pixel wide column that sits 30px from the right side of a 100px selection.
252+
For width to be specified, it **must** have a pipe on either side. If only one pipe between two values is specified, the values will be treated as left and right offsets. If a third pipe exists, it and anything after it is ignored.
253+
254+
#### Examples:
232255

233-
`| 10px | ( vL, 100px, 30px)`
256+
- `(v, ~|~)`
257+
A centered grid.
234258

235259
## Errors
236260

0 commit comments

Comments
 (0)