Skip to content

Commit d47c7fc

Browse files
committed
Update index.tsx
1 parent 61357ae commit d47c7fc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/frontend/settings/quickcss/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
*/
158163
function 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+
*/
166175
export function QuickCssViewModal() {
167176
const { editorCode } = useQuickCssState();
168177
const [cssStats, setCssStats] = useState<{ rules: number; bytes: number; kilobytes: string } | null>(null);

0 commit comments

Comments
 (0)