Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anubra266 committed Jan 26, 2024
1 parent 568498d commit 9694af5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions docs/rules/no-invalid-token-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ import { Circle } from './panda/jsx';
function App(){
// \`1\` does not exist in borderWidths, and \`grays\` is not a valid color token. Assuming we're using the default panda presets
return <Circle _hover={{ border: 'solid {borderWidths.1} token(colors.grays.100, #F3F4F6)' }} />;
}
};

import { css } from './panda/css';

const className = css`
font-size: {fontSizes.emd};
`
```

✔️ Examples of **correct** code:
Expand All @@ -48,7 +54,13 @@ import { Circle } from './panda/jsx';

function App(){
return <Circle _hover={{ border: 'solid 1px token(colors.gray.100, #F3F4F6)' }} />;
}
};

import { css } from './panda/css';

const className = css`
font-size: {fontSizes.md};
`
```

## Resources
Expand Down
4 changes: 2 additions & 2 deletions plugin/tests/no-invalid-token-paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import rule, { RULE_NAME } from '../src/rules/no-invalid-token-paths'

const javascript = String.raw

const validLiteral = 'const className = css`\n font-size: {fontSizes.md};`'
const invalidLiteral = 'const className = css`\n font-size: {fontSizes.emd};`'
const validLiteral = 'const className = css`\n font-size: {fontSizes.md};\n`'
const invalidLiteral = 'const className = css`\n font-size: {fontSizes.emd};\n`'

const valids = [
{
Expand Down

0 comments on commit 9694af5

Please sign in to comment.