File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/frontend/settings/quickcss Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,11 @@ export const MillenniumQuickCssEditor = () => {
155155 ) ;
156156} ;
157157
158+ /**
159+ * Get statistics about the CSS content.
160+ * @param cssContent CSS content to analyze
161+ * @returns An object containing the number of rules, bytes, and kilobytes
162+ */
158163function getCssStats ( cssContent : string ) {
159164 const rules = ( cssContent . match ( / [ ^ { } ] * { [ ^ } ] * } / g) || [ ] ) . length ;
160165 const bytes = new TextEncoder ( ) . encode ( cssContent ) . length ;
@@ -163,6 +168,10 @@ function getCssStats(cssContent: string) {
163168 return { rules, bytes, kilobytes } ;
164169}
165170
171+ /**
172+ * Quick CSS View Modal
173+ * @returns A React component that displays information about Quick CSS and provides a button to open the editor.
174+ */
166175export function QuickCssViewModal ( ) {
167176 const { editorCode } = useQuickCssState ( ) ;
168177 const [ cssStats , setCssStats ] = useState < { rules : number ; bytes : number ; kilobytes : string } | null > ( null ) ;
You can’t perform that action at this time.
0 commit comments