Skip to content

Commit 0867d49

Browse files
committed
docs(layout): improve css utility descriptions and headers
1 parent 706f63e commit 0867d49

File tree

5 files changed

+69
-23
lines changed

5 files changed

+69
-23
lines changed

docs/layout/css-utilities.md

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If your app was not started using an available Ionic Framework starter, the styl
1818

1919
## Text Modification
2020

21-
### Text Alignment
21+
### Text Align
2222

2323
```html
2424
<ion-grid>
@@ -76,7 +76,7 @@ If your app was not started using an available Ionic Framework starter, the styl
7676
| `.ion-text-wrap` | `white-space: normal` | Sequences of whitespace are collapsed. Newline characters in the source are handled as other whitespace. Breaks lines as necessary to fill line boxes. |
7777
| `.ion-text-nowrap` | `white-space: nowrap` | Collapses whitespace as for `normal`, but suppresses line breaks (text wrapping) within text. |
7878

79-
### Text Transformation
79+
### Text Transform
8080

8181
```html
8282
<ion-grid>
@@ -125,7 +125,7 @@ The table below shows the default behavior, where `{modifier}` is any of the fol
125125

126126
## Element Placement
127127

128-
### Float Elements
128+
### Float
129129

130130
The [float](https://developer.mozilla.org/en-US/docs/Web/CSS/float) CSS property specifies that an element should be placed along the left or right side of its container, where text and inline elements will wrap around it. This way, the element is taken from the normal flow of the web page, though still remaining a part of the flow, contrary to absolute positioning.
131131

@@ -188,8 +188,12 @@ The table below shows the default behavior, where `{modifier}` is any of the fol
188188

189189
## Element Display
190190

191+
### Display
192+
191193
The [display](https://developer.mozilla.org/en-US/docs/Web/CSS/display) CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex. It can also be used to completely hide an element from the layout.
192194

195+
Ionic provides the following utility classes for `display`:
196+
193197
| Class | Style Rule | Description |
194198
| ----------- | --------------- | --------------------------- |
195199
| `.ion-display-none` | `display: none` | Turns off the display of an element so that it has no effect on layout (the document is rendered as though the element did not exist). |
@@ -236,7 +240,7 @@ The following classes are deprecated and will be removed in the next major relea
236240

237241
## Content Space
238242

239-
### Element Padding
243+
### Padding
240244

241245
The padding class sets the padding area of an element. The padding area is the space between the content of the element and its border.
242246

@@ -286,7 +290,7 @@ The default amount of `padding` to be applied is `16px` and is set by the `--ion
286290
| `.ion-padding-horizontal` | `padding: 0 16px` | Applies padding to the left and right. |
287291
| `.ion-no-padding` | `padding: 0` | Applies no padding to all sides. |
288292

289-
### Element Margin
293+
### Margin
290294

291295
The margin area extends the border area with an empty area used to separate the element from its neighbors.
292296

@@ -344,8 +348,12 @@ Flexbox properties are divided into two categories: **container properties** tha
344348

345349
### Align Items
346350

351+
The [align-items](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) CSS property sets the [align-self](#align-self) value on all direct children as a group. In flexbox, it controls the alignment of items on the cross axis. In grid layout, it controls the alignment of items on the block axis within their grid areas.
352+
347353
<img src={require('@site/static/img/layout/align-items.png').default} />
348354

355+
Ionic provides the following utility classes for `align-items`:
356+
349357
| Class | Style Rule | Description |
350358
| ------------------------------ | -------------------------------- | --------------------------------------------------------------------------- |
351359
| `.ion-align-items-start` | `align-items: flex-start` | Items are packed toward the start on the cross axis. |
@@ -356,8 +364,14 @@ Flexbox properties are divided into two categories: **container properties** tha
356364

357365
### Align Content
358366

367+
The [align-content](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content) CSS property sets the distribution of space between and around content items along a flexbox's cross axis, or a grid or block-level element's block axis.
368+
369+
This property has no effect on single line flex containers (i.e., ones with `flex-wrap: nowrap`).
370+
359371
<img src={require('@site/static/img/layout/align-content.png').default} />
360372

373+
Ionic provides the following utility classes for `align-content`:
374+
361375
| Class | Style Rule | Description |
362376
| ------------------------------ | -------------------------------- | --------------------------------------------------------------------------- |
363377
| `.ion-align-content-start` | `align-content: flex-start` | Lines are packed toward the start of the cross axis. |
@@ -369,8 +383,12 @@ Flexbox properties are divided into two categories: **container properties** tha
369383

370384
### Justify Content
371385

386+
The [justify-content](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) CSS property defines how the browser distributes space between and around content items along the main axis of a flex container and the inline axis of grid and multicol containers.
387+
372388
<img src={require('@site/static/img/layout/justify-content.png').default} />
373389

390+
Ionic provides the following utility classes for `justify-content`:
391+
374392
| Class | Style Rule | Description |
375393
| ------------------------------ | -------------------------------- | --------------------------------------------------------------------------- |
376394
| `.ion-justify-content-start` | `justify-content: flex-start` | Items are packed toward the start on the main axis. |
@@ -382,8 +400,12 @@ Flexbox properties are divided into two categories: **container properties** tha
382400

383401
### Flex Direction
384402

403+
The [flex-direction](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction) CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed).
404+
385405
<img src={require('@site/static/img/layout/flex-direction.png').default} />
386406

407+
Ionic provides the following utility classes for `flex-direction`:
408+
387409
| Class | Style Rule | Description |
388410
| ------------------------------ | -------------------------------- | --------------------------------------------------------------------------- |
389411
| `.ion-flex-row` | `flex-direction: row` | Items are placed in the same direction as the text direction. |
@@ -393,8 +415,12 @@ Flexbox properties are divided into two categories: **container properties** tha
393415

394416
### Flex Wrap
395417

418+
The [flex-wrap](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap) CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked.
419+
396420
<img src={require('@site/static/img/layout/flex-wrap.png').default} />
397421

422+
Ionic provides the following utility classes for `flex-wrap`:
423+
398424
| Class | Style Rule | Description |
399425
| ------------------------------ | -------------------------------- | --------------------------------------------------------------------------- |
400426
| `.ion-flex-nowrap` | `flex-wrap: nowrap` | Items will all be on one line. |
@@ -435,8 +461,14 @@ Flex item properties control how individual flex items behave within their flex
435461

436462
### Align Self
437463

464+
The [align-self](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self) CSS property overrides a grid or flex item's align-items value. In grid, it aligns the item inside the grid area. In flexbox, it aligns the item on the cross axis.
465+
466+
The property doesn't apply to block-level boxes, or to table cells. If a flexbox item's cross-axis margin is `auto`, then `align-self` is ignored.
467+
438468
<img src={require('@site/static/img/layout/align-self.png').default} />
439469

470+
Ionic provides the following utility classes for `align-self`:
471+
440472
| Class | Style Rule | Description |
441473
| -------------------------- | ------------------------ | ---------------------------------------------------------------------- |
442474
| `.ion-align-self-start` | `align-self: flex-start` | Item is packed toward the start on the cross axis. |
@@ -448,7 +480,7 @@ Flex item properties control how individual flex items behave within their flex
448480

449481
### Flex
450482

451-
The `flex` property is a shorthand for `flex-grow`, `flex-shrink` and `flex-basis`. It controls how flex items grow and shrink within their container.
483+
The [flex](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) CSS property is a shorthand property for `flex-grow`, `flex-shrink` and `flex-basis`. It sets how a flex item will grow or shrink to fit the space available in its flex container.
452484

453485
```html
454486
<ion-grid>
@@ -502,6 +534,8 @@ The `flex` property is a shorthand for `flex-grow`, `flex-shrink` and `flex-basi
502534
</ion-grid>
503535
```
504536

537+
Ionic provides the following utility classes for `flex`:
538+
505539
| Class | Style Rule | Description |
506540
| ------------------- | --------------------- | --------------------------------------------------------------------------- |
507541
| `.ion-flex-1` | `flex: 1` | Item grows and shrinks equally with other flex items. |
@@ -511,6 +545,8 @@ The `flex` property is a shorthand for `flex-grow`, `flex-shrink` and `flex-basi
511545

512546
### Flex Grow
513547

548+
The [flex-grow](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow) CSS property sets the flex grow factor, which specifies how much of the flex container's positive free space, if any, should be assigned to the flex item's main size.
549+
514550
```html
515551
<ion-grid>
516552
<ion-row>
@@ -527,13 +563,17 @@ The `flex` property is a shorthand for `flex-grow`, `flex-shrink` and `flex-basi
527563
</ion-grid>
528564
```
529565

566+
Ionic provides the following utility classes for `flex-grow`:
567+
530568
| Class | Style Rule | Description |
531569
| -------------------- | -------------------- | --------------------------------------------------------------------------- |
532570
| `.ion-flex-grow-0` | `flex-grow: 0` | Item does not grow beyond its content size. |
533571
| `.ion-flex-grow-1` | `flex-grow: 1` | Item grows to fill available space proportionally. |
534572

535573
### Flex Shrink
536574

575+
The [flex-shrink](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink) CSS property sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, the flex items can shrink to fit according to their `flex-shrink` value. Each flex line's negative free space is distributed between the line's flex items that have a `flex-shrink` value greater than `0`.
576+
537577
```html
538578
<ion-grid>
539579
<ion-row>
@@ -550,13 +590,17 @@ The `flex` property is a shorthand for `flex-grow`, `flex-shrink` and `flex-basi
550590
</ion-grid>
551591
```
552592

593+
Ionic provides the following utility classes for `flex-shrink`:
594+
553595
| Class | Style Rule | Description |
554596
| ---------------------- | ---------------------- | --------------------------------------------------------------------------- |
555597
| `.ion-flex-shrink-0` | `flex-shrink: 0` | Item does not shrink below its content size. |
556598
| `.ion-flex-shrink-1` | `flex-shrink: 1` | Item shrinks proportionally when container is too small. |
557599

558600
### Order
559601

602+
The [order](https://developer.mozilla.org/en-US/docs/Web/CSS/order) CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending `order` value and then by their source code order. Items not given an explicit `order` value are assigned the default value of `0`.
603+
560604
```html
561605
<ion-grid>
562606
<ion-row>
@@ -576,6 +620,8 @@ The `flex` property is a shorthand for `flex-grow`, `flex-shrink` and `flex-basi
576620
</ion-grid>
577621
```
578622

623+
Ionic provides the following utility classes for `order`:
624+
579625
| Class | Style Rule | Description |
580626
| ------------------- | ------------- | --------------------------------------------------------------------------- |
581627
| `.ion-order-first` | `order: -1` | Item appears first in the flex container. |
@@ -610,7 +656,7 @@ The table below shows the default behavior, where `{property}` is one of the fol
610656

611657
## Border Display
612658

613-
The border display CSS property determines if the border should be visible or not. The property can be applied to the ion-header and the ion-footer.
659+
The `.ion-no-border` utility class can be used to remove borders from Ionic components. This class can be applied to the `ion-header` and `ion-footer` components.
614660

615661
```html
616662
<ion-header class="ion-no-border">

versioned_docs/version-v5/api/item.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The below chart details the item slots and where it will place the element insid
5252
| `end` | Placed to the right of all other content in LTR, and to the `left` in RTL. |
5353
| none | Placed inside of the input wrapper. |
5454

55-
### Text Alignment
55+
### Text Align
5656

5757
Items left align text and add an ellipsis when the text is wider than the item. See the [CSS Utilities Documentation](../layout/css-utilities.md) for classes that can be added to `<ion-item>` to transform the text.
5858

versioned_docs/version-v5/layout/css-utilities.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If your app was not started using an available Ionic Framework starter, the styl
1212

1313
## Text Modification
1414

15-
### Text Alignment
15+
### Text Align
1616

1717
```html
1818
<ion-grid>
@@ -70,7 +70,7 @@ If your app was not started using an available Ionic Framework starter, the styl
7070
| `.ion-text-wrap` | `white-space: normal` | Sequences of whitespace are collapsed. Newline characters in the source are handled as other whitespace. Breaks lines as necessary to fill line boxes. |
7171
| `.ion-text-nowrap` | `white-space: nowrap` | Collapses whitespace as for `normal`, but suppresses line breaks (text wrapping) within text. |
7272

73-
### Text Transformation
73+
### Text Transform
7474

7575
```html
7676
<ion-grid>
@@ -203,7 +203,7 @@ There are also additional classes to modify the visibility based on the screen s
203203

204204
## Content Space
205205

206-
### Element Padding
206+
### Padding
207207

208208
The padding class sets the padding area of an element. The padding area is the space between the content of the element and its border.
209209

@@ -253,7 +253,7 @@ The default amount of `padding` to be applied is `16px` and is set by the `--ion
253253
| `.ion-padding-horizontal` | `padding: 0 16px` | Applies padding to the left and right. |
254254
| `.ion-no-padding` | `padding: 0` | Applies no padding to all sides. |
255255

256-
### Element Margin
256+
### Margin
257257

258258
The margin area extends the border area with an empty area used to separate the element from its neighbors.
259259

@@ -493,7 +493,7 @@ The default amount of `margin` to be applied is `16px` and is set by the `--ion-
493493

494494
## Border Display
495495

496-
The border display CSS property determines if the border should be visible or not. The property can be applied to the ion-header and the ion-footer.
496+
The `.ion-no-border` utility class can be used to remove borders from Ionic components. This class can be applied to the `ion-header` and `ion-footer` components.
497497

498498
```html
499499
<ion-header class="ion-no-border">

versioned_docs/version-v6/layout/css-utilities.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If your app was not started using an available Ionic Framework starter, the styl
1818

1919
## Text Modification
2020

21-
### Text Alignment
21+
### Text Align
2222

2323
```html
2424
<ion-grid>
@@ -76,7 +76,7 @@ If your app was not started using an available Ionic Framework starter, the styl
7676
| `.ion-text-wrap` | `white-space: normal` | Sequences of whitespace are collapsed. Newline characters in the source are handled as other whitespace. Breaks lines as necessary to fill line boxes. |
7777
| `.ion-text-nowrap` | `white-space: nowrap` | Collapses whitespace as for `normal`, but suppresses line breaks (text wrapping) within text. |
7878

79-
### Text Transformation
79+
### Text Transform
8080

8181
```html
8282
<ion-grid>
@@ -209,7 +209,7 @@ There are also additional classes to modify the visibility based on the screen s
209209

210210
## Content Space
211211

212-
### Element Padding
212+
### Padding
213213

214214
The padding class sets the padding area of an element. The padding area is the space between the content of the element and its border.
215215

@@ -259,7 +259,7 @@ The default amount of `padding` to be applied is `16px` and is set by the `--ion
259259
| `.ion-padding-horizontal` | `padding: 0 16px` | Applies padding to the left and right. |
260260
| `.ion-no-padding` | `padding: 0` | Applies no padding to all sides. |
261261

262-
### Element Margin
262+
### Margin
263263

264264
The margin area extends the border area with an empty area used to separate the element from its neighbors.
265265

@@ -499,7 +499,7 @@ The default amount of `margin` to be applied is `16px` and is set by the `--ion-
499499

500500
## Border Display
501501

502-
The border display CSS property determines if the border should be visible or not. The property can be applied to the ion-header and the ion-footer.
502+
The `.ion-no-border` utility class can be used to remove borders from Ionic components. This class can be applied to the `ion-header` and `ion-footer` components.
503503

504504
```html
505505
<ion-header class="ion-no-border">

versioned_docs/version-v7/layout/css-utilities.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If your app was not started using an available Ionic Framework starter, the styl
2020

2121
## Text Modification
2222

23-
### Text Alignment
23+
### Text Align
2424

2525
```html
2626
<ion-grid>
@@ -78,7 +78,7 @@ If your app was not started using an available Ionic Framework starter, the styl
7878
| `.ion-text-wrap` | `white-space: normal` | Sequences of whitespace are collapsed. Newline characters in the source are handled as other whitespace. Breaks lines as necessary to fill line boxes. |
7979
| `.ion-text-nowrap` | `white-space: nowrap` | Collapses whitespace as for `normal`, but suppresses line breaks (text wrapping) within text. |
8080

81-
### Text Transformation
81+
### Text Transform
8282

8383
```html
8484
<ion-grid>
@@ -228,7 +228,7 @@ There are also additional classes to modify the visibility based on the screen s
228228

229229
## Content Space
230230

231-
### Element Padding
231+
### Padding
232232

233233
The padding class sets the padding area of an element. The padding area is the space between the content of the element and its border.
234234

@@ -278,7 +278,7 @@ The default amount of `padding` to be applied is `16px` and is set by the `--ion
278278
| `.ion-padding-horizontal` | `padding: 0 16px` | Applies padding to the left and right. |
279279
| `.ion-no-padding` | `padding: 0` | Applies no padding to all sides. |
280280

281-
### Element Margin
281+
### Margin
282282

283283
The margin area extends the border area with an empty area used to separate the element from its neighbors.
284284

@@ -518,7 +518,7 @@ The default amount of `margin` to be applied is `16px` and is set by the `--ion-
518518

519519
## Border Display
520520

521-
The border display CSS property determines if the border should be visible or not. The property can be applied to the ion-header and the ion-footer.
521+
The `.ion-no-border` utility class can be used to remove borders from Ionic components. This class can be applied to the `ion-header` and `ion-footer` components.
522522

523523
```html
524524
<ion-header class="ion-no-border">

0 commit comments

Comments
 (0)