Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#9196: Created the universal caption icon #9197

Merged
merged 5 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,5 @@ The script reduces the icon size up to 70%, depending on the software used to cr

**Note**: You may still need to tweak the source code of the SVG files manually after using the script:

* The icons should have the `viewBox` attribute (instead of `width` and `height`). The `removeDimensions` SVGO plugin will not remove `width` and `height` if there is no `viewBox` attribute so make sure it is present.
* Sometimes SVGO leaves empty (transparent) groups `<g>...</g>`. They should be removed from the source.
* Sometimes SVGO leaves empty (transparent) groups `<g>...</g>`. They should be removed from the source and running `clean-up-svg-icons` again usually does that.
* Make sure the number of `<path>` elements is minimal. Merge paths whenever possible in the image processor before saving the file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"style-loader": "^1.2.1",
"stylelint": "^13.5.0",
"stylelint-config-ckeditor5": "^2.0.0",
"svgo": "^1.3.2",
"svgo": "^2.2.2",
"terser-webpack-plugin": "^3.0.2",
"tippy.js": "^6.2.7",
"umberto": "^1.6.2",
Expand Down
2 changes: 2 additions & 0 deletions packages/ckeditor5-core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export { default as secureSourceElement } from './editor/utils/securesourceeleme
export { default as PendingActions } from './pendingactions';

import cancel from './../theme/icons/cancel.svg';
import caption from './../theme/icons/caption.svg';
import check from './../theme/icons/check.svg';
import eraser from './../theme/icons/eraser.svg';
import lowVision from './../theme/icons/low-vision.svg';
Expand All @@ -51,6 +52,7 @@ import threeVerticalDots from './../theme/icons/three-vertical-dots.svg';

export const icons = {
cancel,
caption,
check,
eraser,
lowVision,
Expand Down
1 change: 1 addition & 0 deletions packages/ckeditor5-core/theme/icons/caption.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion scripts/clean-up-svg-icons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ do
then
echo "\x1B[33m[clean-up-svg-icons]\x1B[0m Note: \"$i\" is blacklisted, skipping."
else
svgo --config=./scripts/svgo.config.json -i $i
svgo --config=./scripts/svgo.config.js -i $i
fi
done
34 changes: 34 additions & 0 deletions scripts/svgo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* eslint-env node */

const { extendDefaultPlugins } = require( 'svgo' );

module.exports = {
plugins: extendDefaultPlugins( [
{
name: 'removeViewBox',
active: false
},
{ name: 'collapseGroups' },
{ name: 'removeDimensions' },
{
name: 'removeAttrs',
params: {
attrs: '(fill|stroke|fill-rule)'
}
},
{
name: 'convertPathData',
params: {
noSpaceAfterFlags: false
}
},
{ name: 'removeTitle' },
{ name: 'removeComments' },
{ name: 'removeMetadata' }
] )
};
11 changes: 0 additions & 11 deletions scripts/svgo.config.json

This file was deleted.