* Use react for settings popup * Update options * Update styling * Remove unused type conversions * Remove unused controls function * Update project structure * Delete unused code * Legacy ui components * Refactor files * Update styling * Update UI components * Remove unused code * Remove unused code * Improve theming * Update icon color * Improve custom domains * Update extension * Add delete functionalty for custom domains * Improve icon sizes on screen * Implement icon bindings dialog * Minor improvements * Add tooltips * Support lookup of language ids in manifest * Implement watch mode for development purposes * Improve language id binding customization * Adjust node script * Improve reset functionality * Adjust node script * Minor improvements * Update binding controls with icons * Organize imports * Update error message * Adjust icon binding dialog * Add Info Popover * Update autocomplete behavior * Fix image issue * Minor improvements * Clean up code * Make appbar sticky * Improve project structure * Update info text * Adjust styling * Update styling * Improve adding new bindings * Adjust tsconfig * Support switch of themes for the icon preview * Update watch script * Improve error handling * Move build languages step before build src
17 lines
605 B
TypeScript
17 lines
605 B
TypeScript
import { addConfigChangeListener, getConfig } from './user-config';
|
|
|
|
export const iconSizes = ['sm', 'md', 'lg', 'xl'];
|
|
export type IconSize = (typeof iconSizes)[number];
|
|
|
|
const setSizeAttribute = (iconSize: IconSize) =>
|
|
document.body.setAttribute(`data-material-icons-extension-size`, iconSize);
|
|
|
|
export const initIconSizes = () => {
|
|
const setIconSize = () => getConfig('iconSize').then(setSizeAttribute);
|
|
|
|
document.addEventListener('DOMContentLoaded', setIconSize, false);
|
|
|
|
addConfigChangeListener('iconSize', setSizeAttribute);
|
|
addConfigChangeListener('iconSize', setIconSize, 'default');
|
|
};
|