You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,3 +75,54 @@ Inorder to publish the package to npm, do the following
75
75
1. run `npm run relese` and push changes to main branch.
76
76
2. raise a pull request from `main` branch to `npm` branch. Once the pull request is merged
77
77
and the code pushed to npm branch, GitHub actions will automatically publish the library to npm.
78
+
79
+
## API
80
+
81
+
Below is a markdown documentation for the `CSSLanguageService` object, detailing its functions and usage. This can be used as part of a project's documentation, README, or developer guide.
82
+
83
+
---
84
+
85
+
## CSSLanguageService API
86
+
87
+
The `CSSLanguageService` provides utility functions for parsing CSS and
88
+
retrieving CSS selectors(document symbols such as classes, IDs, and other selectors) from given text content.
89
+
90
+
### Methods
91
+
92
+
#### `getAllSymbols(text, cssMode, filePath)`
93
+
94
+
Retrieves all CSS selectors from the provided CSS text as an array of strings.
95
+
96
+
**Parameters**:
97
+
98
+
-`text` (`string`): The CSS code to analyze.
99
+
-`cssMode` (`string`): The mode of the CSS document. This should correspond to one of the supported CSS modes (e.g., CSS, SCSS, LESS) defined in `CSS_MODES`.
100
+
-`filePath` (`string`): Optional. The path of the CSS file, used for resolving relative URLs within the CSS. Defaults to `"file://placeholder.css"`.
101
+
102
+
**Returns**:
103
+
104
+
-`Array[string]`: An array containing all the CSS selectors found in the document.
0 commit comments