/** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ import IconView from '../../../src/icon/iconview'; import testUtils from '../../_utils/utils'; const icon = ` `; const iconDirty = ` Title Desc `; const iconViewBox = ` `; const ui = testUtils.createTestUIView( { 'icon20': '#icon20', 'icon40': '#icon40', 'icon60': '#icon60', 'iconRed': '#icon-red', 'iconBlueInherited': '#icon-blue-inherited', 'iconDirty': '#icon-dirty', 'iconViewBox': '#icon-view-box' } ); ui.icon20.add( getIcon( icon, 20 ) ); ui.icon40.add( getIcon( icon, 40 ) ); ui.icon60.add( getIcon( icon, 60 ) ); ui.iconRed.add( getIcon( icon, 20, 'red' ) ); ui.iconBlueInherited.add( getIcon( icon, 20 ) ); ui.iconDirty.add( getIcon( iconDirty, 100, 'green' ) ); ui.iconViewBox.add( getIcon( iconViewBox, 100, 'green' ) ); function getIcon( content, size, color ) { const iconView = new IconView(); iconView.render(); iconView.content = content; if ( size ) { iconView.element.style.width = `${ size }px`; iconView.element.style.height = `${ size }px`; } if ( color ) { iconView.element.style.color = color; } return iconView; }