Skip to content

Commit e58a2b4

Browse files
committed
Add docs
1 parent ca3d8da commit e58a2b4

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ Where rules are included in the configs `recommended`, or `all` it is indicated
8888
| [`@pandacss/no-important`](docs/rules/no-important.md) | |
8989
| [`@pandacss/no-invalid-token-paths`](docs/rules/no-invalid-token-paths.md) | ✔️ |
9090
| [`@pandacss/no-invalid-nesting`](docs/rules/no-invalid-nesting.md) | ✔️ |
91-
| [`@pandacss/no-property-renaming`](docs/rules/no-property-renaming.md) | ✔️ |
91+
| [`@pandacss/no-margin-properties`](docs/rules/no-margin-properties.md) | |
9292
| [`@pandacss/no-physical-properties`](docs/rules/no-physical-properties.md) | |
93+
| [`@pandacss/no-property-renaming`](docs/rules/no-property-renaming.md) | ✔️ |
9394
| [`@pandacss/no-unsafe-token-fn-usage`](docs/rules/no-unsafe-token-fn-usage.md) | |
9495
| [`@pandacss/prefer-longhand-properties`](docs/rules/prefer-longhand-properties.md) | |
9596
| [`@pandacss/prefer-shorthand-properties`](docs/rules/prefer-shorthand-properties.md) | |

docs/rules/no-margin-properties.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[//]: # (This file is generated by eslint-docgen. Do not edit it directly.)
2+
3+
# no-margin-properties
4+
5+
Discourage using margin properties for spacing; prefer defining spacing in parent elements with `flex` or `grid` using the `gap` property for a more resilient layout. Margins make components less reusable in other contexts.
6+
7+
📋 This rule is enabled in `plugin:@pandacss/all`.
8+
9+
## Rule details
10+
11+
❌ Examples of **incorrect** code:
12+
```js
13+
import { css } from './panda/css';
14+
15+
const styles = css({ marginLeft: '4' });
16+
```
17+
```js
18+
19+
import { css } from './panda/css';
20+
21+
function App(){
22+
return <div className={css({ margin: '3' })} />;
23+
};
24+
```
25+
```js
26+
27+
import { Circle } from './panda/jsx';
28+
29+
function App(){
30+
return <Circle marginX="2" />;
31+
}
32+
```
33+
34+
✔️ Examples of **correct** code:
35+
```js
36+
import { css } from './panda/css';
37+
38+
const styles = css({ display: 'flex', gap: '4' });
39+
```
40+
```js
41+
42+
import { grid } from './panda/css';
43+
44+
function App(){
45+
return <div className={grid({ gap: '3' })} />;
46+
};
47+
```
48+
```js
49+
50+
import { Flex } from './panda/jsx';
51+
52+
function App(){
53+
return <Flex gap="2" />;
54+
}
55+
```
56+
57+
## Resources
58+
59+
* [Rule source](/plugin/src/rules/no-margin-properties.ts)
60+
* [Test source](/tests/no-margin-properties.test.ts)

0 commit comments

Comments
 (0)