Skip to content

Commit c3db2ff

Browse files
authored
docs: fix container.atPosition() API (postcss#264)
1 parent 91a0147 commit c3db2ff

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

API.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,18 @@ Arguments:
395395

396396
### `container.atPosition(line, column)`
397397

398-
Returns the node at the source position `index`.
398+
Returns the node at the source position `line` and `column`.
399399

400400
```js
401-
selector.at(0) === selector.first;
402-
selector.at(0) === selector.nodes[0];
401+
// Input: :not(.foo),\n#foo > :matches(ol, ul)
402+
selector.atPosition(1, 1); // => :not(.foo)
403+
selector.atPosition(2, 1); // => \n#foo
403404
```
404405

405406
Arguments:
406407

407-
* `index`: The index of the node to return.
408+
* `line`: The line number of the node to return.
409+
* `column`: The column number of the node to return.
408410

409411
### `container.index(node)`
410412

0 commit comments

Comments
 (0)