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

feat: add support for svg icons #74

Merged
merged 14 commits into from
Jun 29, 2020
2 changes: 1 addition & 1 deletion ck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ case "$COMMAND" in
cd ckeditor-dev

# Convert svg icons to png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this comment is no longer acurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upsy

node ../support/svgToPng.js skins/moono-lexicon/icons/icons.json skins/moono-lexicon/icons
node ../support/iconsClassesGenerator.js skins/moono-lexicon/icons/icons.json skins/moono-lexicon/icons.css

if [ -n "$DEBUG" ]; then
dev/builder/build.sh --build-config ../../../support/build-config.js \
Expand Down
Binary file removed skins/moono-lexicon/dev/icons16.png
Binary file not shown.
175 changes: 0 additions & 175 deletions skins/moono-lexicon/dev/icons16.svg

This file was deleted.

Binary file removed skins/moono-lexicon/dev/icons32.png
Binary file not shown.
167 changes: 0 additions & 167 deletions skins/moono-lexicon/dev/icons32.svg

This file was deleted.

145 changes: 0 additions & 145 deletions skins/moono-lexicon/dev/locations.json

This file was deleted.

3 changes: 3 additions & 0 deletions skins/moono-lexicon/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ other files.
/* Styles for notifications. */
@import url('notification.css');

/* Icons */
@import url('icons.css');

/* Important!
To avoid showing the editor UI while its styles are still not available, the
editor creates it with visibility:hidden. Here, we restore the UI visibility. */
Expand Down
4 changes: 4 additions & 0 deletions skins/moono-lexicon/icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cke_hidpi .cke_button_icon {
background-size: 16px !important;
background-position: center !important;
}
Empty file.
41 changes: 32 additions & 9 deletions skins/moono-lexicon/icons/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,59 @@
"align-image-center": "align-image-center",
"align-image-left": "align-image-left",
"align-image-right": "align-image-right",
"anchor": "flag-full",
"anchor": {
"ltr": "flag-full"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here... why just ltr?

I just have no idea what this is supposed to do, it just feels weird :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the others

},
"blockquote": "quote-right",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this one be directional as well? :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is but we don't have the rtl icon yet. I can use the same until we have it or just leave it blank.

"bold": "bold",
"bulletedlist": "list-ul",
"bulletedlist": {
"ltr": "list-ul"
},
"copy": "paste",
"cut": "cut",
"find": "search",
"find": {
"ltr": "search",
"rtl": "search"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this mean to be a different search? Or if they're the same, why separate rtl and ltr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, CKEditor have it as directional so we need to specify the icon for both directions. Probably we'll need to specify other icon, something like search-rtl

},
"hidden": "hidden",
"horizontalrule": "separator",
"image": "picture",
"indent": "indent-more",
"indent": {
"ltr": "indent-more",
"rtl": "indent-less"
},
"italic": "italic",
"justifyblock": "align-justify",
"justifycenter": "align-center",
"justifyleft": "align-left",
"justifyright": "align-right",
"link": "link",
"maximize": "full-size",
"numberedlist": "list-ol",
"outdent": "indent-less",
"redo": "redo",
"numberedlist": {
"ltr": "list-ol"
},
"outdent": {
"ltr": "indent-less",
"rtr": "indent-more"
},
"redo": {
"ltr": "redo",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure these are directional? It kinda makes sense... but I'd love to get some reading about it :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CKEditor have it as directional (automatically uses .cke-ltr or .cke-rtl classes`). I assumed it was correct.

"rtl": "undo"
},
"removeformat": "remove-style",
"replace": "change-list",
"source": "code",
"source": {
"ltr":"code"
},
"strike": "strikethrough",
"subscript": "subscript",
"superscript": "superscript",
"table": "table2",
"underline": "underline",
"undo": "undo",
"undo": {
"ltr": "undo",
"rtl": "redo"
},
"unlink": "chain-broken"
}
}
10 changes: 3 additions & 7 deletions skins/moono-lexicon/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,6 @@ a.cke_button_disabled:hover {
cursor: default;
}

a.cke_button_disabled:focus {
border: 1px #bcbcbc solid;
padding: 3px 5px;
}

.cke_hc a.cke_button_disabled:hover,
.cke_hc a.cke_button_disabled:focus,
.cke_hc a.cke_button_disabled:active {
Expand All @@ -178,9 +173,8 @@ a.cke_button_disabled:focus {
/* This class is applied to the button when the feature associated with the
button cannot be used (grayed-out), i.e. paste button remains disabled when
there is nothing in the clipboard to be pasted. */
a.cke_button_disabled .cke_button_icon,
a.cke_button_disabled .cke_button_arrow {
opacity: 0.3;
border-top: 3px solid #a7a9bc;
}

.cke_hc a.cke_button_disabled {
Expand Down Expand Up @@ -270,6 +264,8 @@ a.cke_button_disabled .cke_button_arrow {
/* Button inner elements. */
/* The icon which is a visual representation of the button. */
.cke_button_icon {
background-size: 16px !important;
background-position: center !important;
cursor: inherit;
background-repeat: no-repeat;
width: 16px;
Expand Down
Loading