@biggora/claude-plugins 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/package.json +1 -1
- package/registry/registry.json +319 -244
- package/specs/coding.md +24 -0
- package/specs/pod.md +2 -0
- package/src/skills/captcha/README.md +221 -0
- package/src/skills/captcha/SKILL.md +355 -0
- package/src/skills/captcha/references/captcha-types.md +254 -0
- package/src/skills/captcha/references/services.md +172 -0
- package/src/skills/captcha/references/stealth.md +238 -0
- package/src/skills/captcha/scripts/solve_captcha.py +323 -0
- package/src/skills/captcha/scripts/solve_image_grid.py +350 -0
- package/src/skills/google-merchant-api/SKILL.md +581 -0
- package/src/skills/google-merchant-api/references/accounts.md +247 -0
- package/src/skills/google-merchant-api/references/content-api-legacy.md +216 -0
- package/src/skills/google-merchant-api/references/datasources.md +233 -0
- package/src/skills/google-merchant-api/references/inventories.md +201 -0
- package/src/skills/google-merchant-api/references/migration.md +267 -0
- package/src/skills/google-merchant-api/references/products.md +316 -0
- package/src/skills/google-merchant-api/references/promotions.md +201 -0
- package/src/skills/google-merchant-api/references/reports.md +240 -0
- package/src/skills/lv-aggregators-api/SKILL.md +113 -0
- package/src/skills/lv-aggregators-api/references/integration-guide.md +368 -0
- package/src/skills/lv-aggregators-api/references/kurpirkt.md +103 -0
- package/src/skills/lv-aggregators-api/references/salidzini.md +122 -0
- package/src/skills/tailwindcss-best-practices/SKILL.md +180 -0
- package/src/skills/tailwindcss-best-practices/references/best-practices-utility-patterns.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/core-installation.md +109 -0
- package/src/skills/tailwindcss-best-practices/references/core-preflight.md +200 -0
- package/src/skills/tailwindcss-best-practices/references/core-responsive.md +163 -0
- package/src/skills/tailwindcss-best-practices/references/core-source-detection.md +114 -0
- package/src/skills/tailwindcss-best-practices/references/core-theme.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/core-utility-classes.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/core-variants.md +204 -0
- package/src/skills/tailwindcss-best-practices/references/effects-form-controls.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/effects-mask.md +91 -0
- package/src/skills/tailwindcss-best-practices/references/effects-scroll-snap.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/effects-text-shadow.md +78 -0
- package/src/skills/tailwindcss-best-practices/references/effects-transition-animation.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/effects-visibility-interactivity.md +82 -0
- package/src/skills/tailwindcss-best-practices/references/features-content-detection.md +175 -0
- package/src/skills/tailwindcss-best-practices/references/features-custom-styles.md +203 -0
- package/src/skills/tailwindcss-best-practices/references/features-dark-mode.md +137 -0
- package/src/skills/tailwindcss-best-practices/references/features-functions-directives.md +241 -0
- package/src/skills/tailwindcss-best-practices/references/features-upgrade.md +160 -0
- package/src/skills/tailwindcss-best-practices/references/layout-aspect-ratio.md +39 -0
- package/src/skills/tailwindcss-best-practices/references/layout-columns.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/layout-display.md +110 -0
- package/src/skills/tailwindcss-best-practices/references/layout-flexbox.md +112 -0
- package/src/skills/tailwindcss-best-practices/references/layout-grid.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/layout-height.md +97 -0
- package/src/skills/tailwindcss-best-practices/references/layout-inset.md +103 -0
- package/src/skills/tailwindcss-best-practices/references/layout-logical-properties.md +92 -0
- package/src/skills/tailwindcss-best-practices/references/layout-margin.md +126 -0
- package/src/skills/tailwindcss-best-practices/references/layout-min-max-sizing.md +63 -0
- package/src/skills/tailwindcss-best-practices/references/layout-object-fit-position.md +64 -0
- package/src/skills/tailwindcss-best-practices/references/layout-overflow.md +57 -0
- package/src/skills/tailwindcss-best-practices/references/layout-padding.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/layout-position.md +85 -0
- package/src/skills/tailwindcss-best-practices/references/layout-tables.md +67 -0
- package/src/skills/tailwindcss-best-practices/references/layout-width.md +102 -0
- package/src/skills/tailwindcss-best-practices/references/transform-base.md +68 -0
- package/src/skills/tailwindcss-best-practices/references/transform-rotate.md +70 -0
- package/src/skills/tailwindcss-best-practices/references/transform-scale.md +83 -0
- package/src/skills/tailwindcss-best-practices/references/transform-skew.md +62 -0
- package/src/skills/tailwindcss-best-practices/references/transform-translate.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/typography-font-text.md +142 -0
- package/src/skills/tailwindcss-best-practices/references/typography-list-style.md +65 -0
- package/src/skills/tailwindcss-best-practices/references/typography-text-align.md +60 -0
- package/src/skills/tailwindcss-best-practices/references/visual-background.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/visual-border.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/visual-effects.md +111 -0
- package/src/skills/tailwindcss-best-practices/references/visual-svg.md +82 -0
- package/src/skills/test-mobile-app/SKILL.md +11 -6
- package/src/skills/test-mobile-app/scripts/analyze_apk.py +15 -4
- package/src/skills/test-mobile-app/scripts/check_environment.py +5 -5
- package/src/skills/test-mobile-app/scripts/run_tests.py +1 -1
- package/src/skills/test-web-ui/SKILL.md +264 -84
- package/src/skills/test-web-ui/scripts/discover.py +25 -12
- package/src/skills/test-web-ui/scripts/run_tests.py +3 -2
- package/src/skills/vite-best-practices/SKILL.md +115 -0
- package/src/skills/vite-best-practices/references/build-and-ssr.md +255 -0
- package/src/skills/vite-best-practices/references/core-config.md +231 -0
- package/src/skills/vite-best-practices/references/core-features.md +222 -0
- package/src/skills/vite-best-practices/references/core-plugin-api.md +294 -0
- package/src/skills/vite-best-practices/references/environment-api.md +108 -0
- package/src/skills/vite-best-practices/references/rolldown-migration.md +242 -0
- package/codex-cli-workspace/iteration-1/benchmark.json +0 -122
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/outputs/response.md +0 -163
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/grading.json +0 -58
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/outputs/response.md +0 -151
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -86
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/grading.json +0 -58
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -164
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/outputs/response.md +0 -130
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/grading.json +0 -64
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/outputs/response.md +0 -209
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/review.html +0 -1325
- package/gemini-cli-workspace/iteration-1/benchmark.json +0 -86
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/outputs/response.md +0 -401
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/outputs/response.md +0 -405
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -212
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -427
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/eval_metadata.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/outputs/response.md +0 -171
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/outputs/response.md +0 -199
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/review.html +0 -1325
- package/gemini-cli-workspace/iteration-2/benchmark.json +0 -173
- package/gemini-cli-workspace/iteration-2/benchmark.md +0 -28
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/outputs/response.md +0 -195
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/outputs/response.md +0 -377
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -127
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -164
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/eval_metadata.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/outputs/response.md +0 -91
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/outputs/response.md +0 -112
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-viewer.html +0 -1325
- package/screen-recording-workspace/evals.json +0 -41
- package/screen-recording-workspace/iteration-1/benchmark.json +0 -102
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/outputs/demo.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/outputs/demo.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/outputs/region_capture.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/outputs/region_capture.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/outputs/fallback_recording.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/outputs/fallback_recording.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/outputs/record_screen.py +0 -67
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/review.html +0 -1325
- package/src/skills/codex-cli/evals/evals.json +0 -47
- package/src/skills/gemini-cli/evals/evals.json +0 -46
- package/src/skills/tm-search/evals/evals.json +0 -23
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-inset
|
|
3
|
+
description: Controlling placement of positioned elements with top, right, bottom, left, and inset utilities
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Top / Right / Bottom / Left
|
|
7
|
+
|
|
8
|
+
Utilities for controlling the placement of positioned elements.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### Basic positioning
|
|
13
|
+
|
|
14
|
+
Use `top-<number>`, `right-<number>`, `bottom-<number>`, `left-<number>` to position elements:
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<!-- Pin to top left corner -->
|
|
18
|
+
<div class="relative size-32">
|
|
19
|
+
<div class="absolute top-0 left-0 size-16">01</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!-- Span top edge -->
|
|
23
|
+
<div class="relative size-32">
|
|
24
|
+
<div class="absolute inset-x-0 top-0 h-16">02</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<!-- Fill entire parent -->
|
|
28
|
+
<div class="relative size-32">
|
|
29
|
+
<div class="absolute inset-0">05</div>
|
|
30
|
+
</div>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Inset utilities
|
|
34
|
+
|
|
35
|
+
Use `inset-<number>` for all sides, `inset-x-<number>` for horizontal, `inset-y-<number>` for vertical:
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<div class="absolute inset-0">Fill parent</div>
|
|
39
|
+
<div class="absolute inset-x-0 top-0">Span top</div>
|
|
40
|
+
<div class="absolute inset-y-0 left-0">Span left</div>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Negative values
|
|
44
|
+
|
|
45
|
+
Prefix with a dash for negative values:
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<div class="relative size-32">
|
|
49
|
+
<div class="absolute -top-4 -left-4 size-14"></div>
|
|
50
|
+
</div>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Logical properties (inline direction)
|
|
54
|
+
|
|
55
|
+
Use `inset-s-<number>` and `inset-e-<number>` for RTL-aware inline positioning:
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<div dir="ltr">
|
|
59
|
+
<div class="absolute inset-s-0 top-0">Left in LTR</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div dir="rtl">
|
|
62
|
+
<div class="absolute inset-s-0 top-0">Right in RTL</div>
|
|
63
|
+
</div>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
> **Deprecation (v4.2):** `start-*` and `end-*` are deprecated. Use `inset-s-*` and `inset-e-*` instead.
|
|
67
|
+
|
|
68
|
+
### Logical properties (block direction, v4.2+)
|
|
69
|
+
|
|
70
|
+
Use `inset-bs-<number>` and `inset-be-<number>` for writing-mode-aware block positioning:
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<div class="absolute inset-bs-0">Block-start: 0</div>
|
|
74
|
+
<div class="absolute inset-be-4">Block-end: 1rem</div>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Percentage and custom values
|
|
78
|
+
|
|
79
|
+
Use fractions for percentages or arbitrary values:
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
|
|
83
|
+
Centered
|
|
84
|
+
</div>
|
|
85
|
+
<div class="absolute top-[117px] left-[20%]">
|
|
86
|
+
Custom position
|
|
87
|
+
</div>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Key Points
|
|
91
|
+
|
|
92
|
+
- `inset-0` sets all sides to 0 (equivalent to `top-0 right-0 bottom-0 left-0`)
|
|
93
|
+
- `inset-x-0` sets left and right to 0
|
|
94
|
+
- `inset-y-0` sets top and bottom to 0
|
|
95
|
+
- Use `inset-s-*`/`inset-e-*` for inline logical properties (`start-*`/`end-*` deprecated in v4.2)
|
|
96
|
+
- Use `inset-bs-*`/`inset-be-*` for block logical properties (v4.2+)
|
|
97
|
+
- Negative values use dash prefix: `-top-4`, `-left-8`
|
|
98
|
+
- Combine with `position` utilities (`absolute`, `fixed`, `relative`, `sticky`)
|
|
99
|
+
|
|
100
|
+
<!--
|
|
101
|
+
Source references:
|
|
102
|
+
- https://tailwindcss.com/docs/top-right-bottom-left
|
|
103
|
+
-->
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-logical-properties
|
|
3
|
+
description: Writing-mode-aware logical property utilities added in Tailwind CSS v4.2 — inline/block sizing, spacing, and inset
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Logical Property Utilities (v4.2+)
|
|
7
|
+
|
|
8
|
+
Writing-mode-aware utilities for internationalization and vertical text support. These use CSS logical properties that adapt to the document's writing mode (LTR, RTL, vertical). Added in Tailwind CSS v4.2.
|
|
9
|
+
|
|
10
|
+
## Logical Sizing
|
|
11
|
+
|
|
12
|
+
Size elements relative to the writing mode:
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<!-- Inline size (width in LTR, height in vertical writing) -->
|
|
16
|
+
<div class="inline-full">Full inline size</div>
|
|
17
|
+
<div class="inline-80">Fixed inline size</div>
|
|
18
|
+
<div class="min-inline-0">Minimum inline size</div>
|
|
19
|
+
<div class="max-inline-lg">Maximum inline size</div>
|
|
20
|
+
|
|
21
|
+
<!-- Block size (height in LTR, width in vertical writing) -->
|
|
22
|
+
<div class="block-screen">Full block size (viewport)</div>
|
|
23
|
+
<div class="block-64">Fixed block size</div>
|
|
24
|
+
<div class="min-block-0">Minimum block size</div>
|
|
25
|
+
<div class="max-block-full">Maximum block size</div>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Block Spacing
|
|
29
|
+
|
|
30
|
+
Spacing utilities for block-start and block-end:
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<!-- Block padding -->
|
|
34
|
+
<div class="pbs-4">Padding block-start: 1rem</div>
|
|
35
|
+
<div class="pbe-8">Padding block-end: 2rem</div>
|
|
36
|
+
|
|
37
|
+
<!-- Block margin -->
|
|
38
|
+
<div class="mbs-4">Margin block-start: 1rem</div>
|
|
39
|
+
<div class="mbe-8">Margin block-end: 2rem</div>
|
|
40
|
+
|
|
41
|
+
<!-- Scroll padding/margin -->
|
|
42
|
+
<div class="scroll-pbs-4">Scroll padding block-start</div>
|
|
43
|
+
<div class="scroll-mbs-4">Scroll margin block-start</div>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Block Borders
|
|
47
|
+
|
|
48
|
+
Border utilities for block direction:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<div class="border-bs border-bs-gray-200">Border block-start</div>
|
|
52
|
+
<div class="border-be-2 border-be-blue-500">Border block-end (2px blue)</div>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Logical Inset
|
|
56
|
+
|
|
57
|
+
Position elements using logical directions:
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<!-- Inline positioning (replaces start-*/end-*) -->
|
|
61
|
+
<div class="absolute inset-s-0">Inline-start: 0</div>
|
|
62
|
+
<div class="absolute inset-e-4">Inline-end: 1rem</div>
|
|
63
|
+
|
|
64
|
+
<!-- Block positioning -->
|
|
65
|
+
<div class="absolute inset-bs-0">Block-start: 0</div>
|
|
66
|
+
<div class="absolute inset-be-4">Block-end: 1rem</div>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> **Deprecation note:** `start-*` and `end-*` utilities are deprecated in v4.2. Use `inset-s-*` and `inset-e-*` instead.
|
|
70
|
+
|
|
71
|
+
## When to Use Logical Properties
|
|
72
|
+
|
|
73
|
+
- **Internationalization (i18n):** When your app supports RTL languages (Arabic, Hebrew)
|
|
74
|
+
- **Vertical writing modes:** For CJK vertical text layouts
|
|
75
|
+
- **Future-proofing:** Logical properties adapt automatically to any writing mode
|
|
76
|
+
|
|
77
|
+
For Western-only LTR layouts, physical properties (`w-*`, `h-*`, `pt-*`, `mb-*`) remain perfectly fine.
|
|
78
|
+
|
|
79
|
+
## Key Points
|
|
80
|
+
|
|
81
|
+
- `inline-*` = width in LTR, height in vertical writing
|
|
82
|
+
- `block-*` = height in LTR, width in vertical writing
|
|
83
|
+
- `pbs-*`/`pbe-*` = padding block-start/end
|
|
84
|
+
- `mbs-*`/`mbe-*` = margin block-start/end
|
|
85
|
+
- `border-bs-*`/`border-be-*` = border block-start/end
|
|
86
|
+
- `inset-s-*`/`inset-e-*` replace deprecated `start-*`/`end-*`
|
|
87
|
+
- All use the spacing scale like regular spacing utilities
|
|
88
|
+
|
|
89
|
+
<!--
|
|
90
|
+
Source references:
|
|
91
|
+
- https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.2.0
|
|
92
|
+
-->
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-margin
|
|
3
|
+
description: Controlling element margins with spacing scale, negative values, logical properties, and space utilities
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Margin
|
|
7
|
+
|
|
8
|
+
Utilities for controlling an element's margin.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### All sides
|
|
13
|
+
|
|
14
|
+
Use `m-<number>` to set margin on all sides:
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<div class="m-4">Margin on all sides</div>
|
|
18
|
+
<div class="m-8">Larger margin</div>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Individual sides
|
|
22
|
+
|
|
23
|
+
Use `mt-<number>`, `mr-<number>`, `mb-<number>`, `ml-<number>`:
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div class="mt-6">Top margin</div>
|
|
27
|
+
<div class="mr-4">Right margin</div>
|
|
28
|
+
<div class="mb-8">Bottom margin</div>
|
|
29
|
+
<div class="ml-2">Left margin</div>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Horizontal and vertical
|
|
33
|
+
|
|
34
|
+
Use `mx-<number>` for horizontal, `my-<number>` for vertical:
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<div class="mx-8">Horizontal margin</div>
|
|
38
|
+
<div class="my-8">Vertical margin</div>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Negative margins
|
|
42
|
+
|
|
43
|
+
Prefix with dash for negative values:
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<div class="-mt-8">Negative top margin</div>
|
|
47
|
+
<div class="-mx-4">Negative horizontal margin</div>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Auto margins
|
|
51
|
+
|
|
52
|
+
Use `m-auto` or directional auto margins for centering:
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div class="mx-auto">Centered horizontally</div>
|
|
56
|
+
<div class="ml-auto">Pushed to right</div>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Logical properties
|
|
60
|
+
|
|
61
|
+
Use `ms-<number>` (margin-inline-start) and `me-<number>` (margin-inline-end) for RTL support:
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<div dir="ltr">
|
|
65
|
+
<div class="ms-8">Left margin in LTR</div>
|
|
66
|
+
<div class="me-8">Right margin in LTR</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div dir="rtl">
|
|
69
|
+
<div class="ms-8">Right margin in RTL</div>
|
|
70
|
+
<div class="me-8">Left margin in RTL</div>
|
|
71
|
+
</div>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Space between children
|
|
75
|
+
|
|
76
|
+
Use `space-x-<number>` or `space-y-<number>` to add margin between children:
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<div class="flex space-x-4">
|
|
80
|
+
<div>01</div>
|
|
81
|
+
<div>02</div>
|
|
82
|
+
<div>03</div>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="flex flex-col space-y-8">
|
|
86
|
+
<div>01</div>
|
|
87
|
+
<div>02</div>
|
|
88
|
+
<div>03</div>
|
|
89
|
+
</div>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Reversing space
|
|
93
|
+
|
|
94
|
+
Use `space-x-reverse` or `space-y-reverse` with reversed flex directions:
|
|
95
|
+
|
|
96
|
+
```html
|
|
97
|
+
<div class="flex flex-row-reverse space-x-4 space-x-reverse">
|
|
98
|
+
<div>01</div>
|
|
99
|
+
<div>02</div>
|
|
100
|
+
<div>03</div>
|
|
101
|
+
</div>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Custom values
|
|
105
|
+
|
|
106
|
+
Use arbitrary values for custom margins:
|
|
107
|
+
|
|
108
|
+
```html
|
|
109
|
+
<div class="m-[5px]">Custom margin</div>
|
|
110
|
+
<div class="mx-[calc(50%-1rem)]">Custom calculation</div>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Key Points
|
|
114
|
+
|
|
115
|
+
- Spacing scale: `m-0` through `m-96` (and beyond)
|
|
116
|
+
- Negative: prefix with dash (`-m-4`, `-mt-8`, `-mx-4`)
|
|
117
|
+
- Auto: `m-auto`, `mx-auto`, `my-auto`, `mt-auto`, etc.
|
|
118
|
+
- Logical: `ms-*` (start), `me-*` (end) adapt to text direction
|
|
119
|
+
- Space utilities: `space-x-*`, `space-y-*` add margin to all children except last
|
|
120
|
+
- Space reverse: `space-x-reverse`, `space-y-reverse` for reversed flex layouts
|
|
121
|
+
- Limitations: Space utilities don't work well with grids or complex layouts - use `gap` utilities instead
|
|
122
|
+
|
|
123
|
+
<!--
|
|
124
|
+
Source references:
|
|
125
|
+
- https://tailwindcss.com/docs/margin
|
|
126
|
+
-->
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-min-max-sizing
|
|
3
|
+
description: Setting minimum and maximum width and height with min-w, max-w, min-h, max-h
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Min & Max Sizing
|
|
7
|
+
|
|
8
|
+
Utilities for constraining element dimensions with minimum and maximum width/height.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### Min width
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<!-- Spacing scale -->
|
|
16
|
+
<div class="min-w-24">min-w-24</div>
|
|
17
|
+
<div class="min-w-64">min-w-64</div>
|
|
18
|
+
|
|
19
|
+
<!-- Percentage -->
|
|
20
|
+
<div class="min-w-full">min-w-full</div>
|
|
21
|
+
<div class="min-w-3/4">min-w-3/4</div>
|
|
22
|
+
|
|
23
|
+
<!-- Container scale -->
|
|
24
|
+
<div class="min-w-sm">min-w-sm</div>
|
|
25
|
+
<div class="min-w-xl">min-w-xl</div>
|
|
26
|
+
|
|
27
|
+
<!-- Content-based -->
|
|
28
|
+
<div class="min-w-min">min-content</div>
|
|
29
|
+
<div class="min-w-max">max-content</div>
|
|
30
|
+
<div class="min-w-fit">fit-content</div>
|
|
31
|
+
<div class="min-w-auto">auto</div>
|
|
32
|
+
|
|
33
|
+
<!-- Custom -->
|
|
34
|
+
<div class="min-w-[220px]">Custom</div>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Max width
|
|
38
|
+
|
|
39
|
+
Use `max-w-<value>` with similar scales: spacing numbers, fractions (`max-w-1/2`), container sizes (`max-w-md`), `max-w-full`, `max-w-screen`, `max-w-min`, `max-w-max`, `max-w-fit`, `max-w-none`.
|
|
40
|
+
|
|
41
|
+
### Min / Max height
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<div class="min-h-screen">At least full viewport height</div>
|
|
45
|
+
<div class="min-h-0">Allow shrinking in flex</div>
|
|
46
|
+
<div class="max-h-96 overflow-y-auto">Scrollable with max height</div>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Key Points
|
|
50
|
+
|
|
51
|
+
- min-w: spacing scale, fractions, container scale (3xs–7xl), `full`, `screen`, `min`, `max`, `fit`, `auto`
|
|
52
|
+
- max-w: same options plus `none`
|
|
53
|
+
- min-h / max-h: similar scales; `min-h-0` important for flex children to shrink
|
|
54
|
+
- Viewport units: `min-w-screen`, `min-w-dvw`, `min-w-svw`, `min-w-lvw`
|
|
55
|
+
- Container scale: `min-w-3xs` through `min-w-7xl` map to `--container-*` variables
|
|
56
|
+
|
|
57
|
+
<!--
|
|
58
|
+
Source references:
|
|
59
|
+
- https://tailwindcss.com/docs/min-width
|
|
60
|
+
- https://tailwindcss.com/docs/max-width
|
|
61
|
+
- https://tailwindcss.com/docs/min-height
|
|
62
|
+
- https://tailwindcss.com/docs/max-height
|
|
63
|
+
-->
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-object-fit-position
|
|
3
|
+
description: Controlling how replaced elements (images, video) are resized and positioned within their container
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Object Fit & Object Position
|
|
7
|
+
|
|
8
|
+
Utilities for controlling how replaced elements like `<img>` and `<video>` are resized and positioned within their container.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### Object fit
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<!-- Cover container, may crop -->
|
|
16
|
+
<img class="h-48 w-96 object-cover" src="photo.jpg" />
|
|
17
|
+
|
|
18
|
+
<!-- Contain within, may letterbox -->
|
|
19
|
+
<img class="h-48 w-96 object-contain" src="photo.jpg" />
|
|
20
|
+
|
|
21
|
+
<!-- Stretch to fill -->
|
|
22
|
+
<img class="h-48 w-96 object-fill" src="photo.jpg" />
|
|
23
|
+
|
|
24
|
+
<!-- Scale down only if needed, else original size -->
|
|
25
|
+
<img class="h-48 w-96 object-scale-down" src="photo.jpg" />
|
|
26
|
+
|
|
27
|
+
<!-- Original size, ignore container -->
|
|
28
|
+
<img class="h-48 w-96 object-none" src="photo.jpg" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Object position
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<!-- Named positions -->
|
|
35
|
+
<img class="size-24 object-cover object-top-left" src="photo.jpg" />
|
|
36
|
+
<img class="size-24 object-cover object-center" src="photo.jpg" />
|
|
37
|
+
<img class="size-24 object-cover object-bottom-right" src="photo.jpg" />
|
|
38
|
+
|
|
39
|
+
<!-- Custom value -->
|
|
40
|
+
<img class="object-cover object-[25%_75%]" src="photo.jpg" />
|
|
41
|
+
<img class="object-(--my-object)" src="photo.jpg" />
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Responsive
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<img class="object-contain md:object-cover object-center md:object-top" src="photo.jpg" />
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Key Points
|
|
51
|
+
|
|
52
|
+
- `object-contain` - maintain aspect ratio, fit inside container
|
|
53
|
+
- `object-cover` - maintain aspect ratio, cover container (may crop)
|
|
54
|
+
- `object-fill` - stretch to fill container
|
|
55
|
+
- `object-scale-down` - like `contain` but never upscale
|
|
56
|
+
- `object-none` - original size, ignore container
|
|
57
|
+
- Position: `object-top-left`, `object-top`, `object-top-right`, `object-left`, `object-center`, `object-right`, `object-bottom-left`, `object-bottom`, `object-bottom-right`
|
|
58
|
+
- Custom: `object-[25%_75%]`, `object-(--custom-property)`
|
|
59
|
+
|
|
60
|
+
<!--
|
|
61
|
+
Source references:
|
|
62
|
+
- https://tailwindcss.com/docs/object-fit
|
|
63
|
+
- https://tailwindcss.com/docs/object-position
|
|
64
|
+
-->
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-overflow
|
|
3
|
+
description: Controlling how elements handle content that overflows their container
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Overflow
|
|
7
|
+
|
|
8
|
+
Utilities for controlling how an element handles content that is too large for the container.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### Basic overflow
|
|
13
|
+
|
|
14
|
+
Use `overflow-auto`, `overflow-hidden`, `overflow-visible`, `overflow-scroll`:
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<div class="overflow-auto">Scrolls if needed</div>
|
|
18
|
+
<div class="overflow-hidden">Clips overflow</div>
|
|
19
|
+
<div class="overflow-visible">Shows overflow</div>
|
|
20
|
+
<div class="overflow-scroll">Always shows scrollbars</div>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Axis-specific overflow
|
|
24
|
+
|
|
25
|
+
Use `overflow-x-*` or `overflow-y-*` for horizontal/vertical control:
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<div class="overflow-x-auto overflow-y-hidden">
|
|
29
|
+
Horizontal scroll, vertical clip
|
|
30
|
+
</div>
|
|
31
|
+
<div class="overflow-x-scroll overflow-y-auto">
|
|
32
|
+
Horizontal always scrolls, vertical scrolls if needed
|
|
33
|
+
</div>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Overflow clip
|
|
37
|
+
|
|
38
|
+
Use `overflow-clip` for clip behavior (similar to hidden but different scroll behavior):
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<div class="overflow-clip">Clips without creating scroll container</div>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Key Points
|
|
45
|
+
|
|
46
|
+
- `overflow-auto` - shows scrollbars only when needed
|
|
47
|
+
- `overflow-hidden` - clips content that overflows
|
|
48
|
+
- `overflow-visible` - allows content to overflow (default for most elements)
|
|
49
|
+
- `overflow-scroll` - always shows scrollbars
|
|
50
|
+
- `overflow-clip` - clips without creating scroll container
|
|
51
|
+
- Use `overflow-x-*` and `overflow-y-*` for axis-specific control
|
|
52
|
+
- Common pattern: `overflow-hidden` for images, `overflow-auto` for scrollable content
|
|
53
|
+
|
|
54
|
+
<!--
|
|
55
|
+
Source references:
|
|
56
|
+
- https://tailwindcss.com/docs/overflow
|
|
57
|
+
-->
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-padding
|
|
3
|
+
description: Controlling element padding with spacing scale, logical properties, and directional utilities
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Padding
|
|
7
|
+
|
|
8
|
+
Utilities for controlling an element's padding.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### All sides
|
|
13
|
+
|
|
14
|
+
Use `p-<number>` to set padding on all sides:
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<div class="p-4">Padding on all sides</div>
|
|
18
|
+
<div class="p-8">Larger padding</div>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Individual sides
|
|
22
|
+
|
|
23
|
+
Use `pt-<number>`, `pr-<number>`, `pb-<number>`, `pl-<number>`:
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div class="pt-6">Top padding</div>
|
|
27
|
+
<div class="pr-4">Right padding</div>
|
|
28
|
+
<div class="pb-8">Bottom padding</div>
|
|
29
|
+
<div class="pl-2">Left padding</div>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Horizontal and vertical
|
|
33
|
+
|
|
34
|
+
Use `px-<number>` for horizontal, `py-<number>` for vertical:
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<div class="px-8">Horizontal padding</div>
|
|
38
|
+
<div class="py-8">Vertical padding</div>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Logical properties
|
|
42
|
+
|
|
43
|
+
Use `ps-<number>` (padding-inline-start) and `pe-<number>` (padding-inline-end) for RTL support:
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<div dir="ltr">
|
|
47
|
+
<div class="ps-8">Left padding in LTR</div>
|
|
48
|
+
<div class="pe-8">Right padding in LTR</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div dir="rtl">
|
|
51
|
+
<div class="ps-8">Right padding in RTL</div>
|
|
52
|
+
<div class="pe-8">Left padding in RTL</div>
|
|
53
|
+
</div>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Custom values
|
|
57
|
+
|
|
58
|
+
Use arbitrary values for custom padding:
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<div class="p-[5px]">Custom padding</div>
|
|
62
|
+
<div class="px-[calc(50%-1rem)]">Custom calculation</div>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Key Points
|
|
66
|
+
|
|
67
|
+
- Spacing scale: `p-0` through `p-96` (and beyond)
|
|
68
|
+
- Individual: `pt-*`, `pr-*`, `pb-*`, `pl-*` for specific sides
|
|
69
|
+
- Axes: `px-*` (horizontal), `py-*` (vertical)
|
|
70
|
+
- Logical: `ps-*` (start), `pe-*` (end) adapt to text direction
|
|
71
|
+
- No negative padding - padding cannot be negative in CSS
|
|
72
|
+
- Common patterns: `p-4`, `px-6`, `py-8`, `pt-2`, `pb-4`
|
|
73
|
+
|
|
74
|
+
<!--
|
|
75
|
+
Source references:
|
|
76
|
+
- https://tailwindcss.com/docs/padding
|
|
77
|
+
-->
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-position
|
|
3
|
+
description: Controlling element positioning with static, relative, absolute, fixed, and sticky utilities
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Position
|
|
7
|
+
|
|
8
|
+
Utilities for controlling how an element is positioned in the document.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### Static positioning
|
|
13
|
+
|
|
14
|
+
Use `static` to position an element according to the normal flow. Offsets are ignored and it won't act as a position reference for absolutely positioned children:
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<div class="static">
|
|
18
|
+
<p>Static parent</p>
|
|
19
|
+
<div class="absolute bottom-0 left-0">
|
|
20
|
+
<p>Absolute child</p>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Relative positioning
|
|
26
|
+
|
|
27
|
+
Use `relative` to position an element in normal flow. Offsets are calculated relative to the element's normal position, and it acts as a position reference for absolutely positioned children:
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<div class="relative">
|
|
31
|
+
<p>Relative parent</p>
|
|
32
|
+
<div class="absolute bottom-0 left-0">
|
|
33
|
+
<p>Absolute child</p>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Absolute positioning
|
|
39
|
+
|
|
40
|
+
Use `absolute` to position an element outside the normal flow. Neighboring elements act as if it doesn't exist. Offsets are calculated relative to the nearest positioned parent:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<div class="relative">
|
|
44
|
+
<div class="absolute top-0 right-0">
|
|
45
|
+
<p>Absolute child</p>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Fixed positioning
|
|
51
|
+
|
|
52
|
+
Use `fixed` to position an element relative to the browser window. Offsets are calculated relative to the viewport:
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div class="fixed top-0 right-0 left-0">
|
|
56
|
+
<p>Fixed header</p>
|
|
57
|
+
</div>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Sticky positioning
|
|
61
|
+
|
|
62
|
+
Use `sticky` to position an element as `relative` until it crosses a threshold, then treat it as `fixed` until its parent is off screen:
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<div>
|
|
66
|
+
<div class="sticky top-0">
|
|
67
|
+
<p>Sticky header</p>
|
|
68
|
+
</div>
|
|
69
|
+
<div>Content...</div>
|
|
70
|
+
</div>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Key Points
|
|
74
|
+
|
|
75
|
+
- `static` is the default - elements flow normally
|
|
76
|
+
- `relative` maintains normal flow but allows offsets and becomes a positioning context
|
|
77
|
+
- `absolute` removes from flow and positions relative to nearest positioned ancestor
|
|
78
|
+
- `fixed` positions relative to viewport, stays in place when scrolling
|
|
79
|
+
- `sticky` combines relative and fixed behavior based on scroll position
|
|
80
|
+
- Always use with offset utilities like `top-0`, `right-0`, `inset-0`, etc.
|
|
81
|
+
|
|
82
|
+
<!--
|
|
83
|
+
Source references:
|
|
84
|
+
- https://tailwindcss.com/docs/position
|
|
85
|
+
-->
|