Skip to content

Commit

Permalink
Editor: Use SVG icons
Browse files Browse the repository at this point in the history
If the icon is only used in the editor, the SVG is now
directly inlined in the CSS.
  • Loading branch information
chris34 committed Mar 13, 2021
1 parent 5cc1a9b commit c18620e
Show file tree
Hide file tree
Showing 23 changed files with 22 additions and 27 deletions.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/bold.png
Binary file not shown.
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/code.png
Binary file not shown.
1 change: 1 addition & 0 deletions inyoka_theme_ubuntuusers/static/img/icons/code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/color.png
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/date.png
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/italic.png
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/link.png
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/mark.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/pre.png
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/quote.png
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/sig.png
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/smiley.png
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/stroke.png
Binary file not shown.
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/icons/user.png
Binary file not shown.
Binary file not shown.
Binary file removed inyoka_theme_ubuntuusers/static/img/user.png
Binary file not shown.
43 changes: 17 additions & 26 deletions inyoka_theme_ubuntuusers/static/style/editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ul.toolbar {
width: 26px;
height: 26px;
background-repeat: no-repeat;
background-size: contain;
border: 1px solid #ddd;
text-align: center;
span {
Expand All @@ -51,61 +52,51 @@ ul.toolbar {
}
}
#button-bold {
background-image: url('../img/icons/bold.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"/></svg>');
}
#button-italic {
background-image: url('../img/icons/italic.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"/></svg>');
}
#button-underlined {
background-image: url('../img/icons/underlined.png');
}
#button-code {
background-image: url('../img/icons/code.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"/></svg>');
}
#button-stroke {
background-image: url('../img/icons/stroke.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"/></svg>');
}
#button-bulletlist {
background-image: url('../img/icons/bulletlist.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"/></svg>');
}
#button-numlist {
background-image: url('../img/icons/numlist.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"/></svg>');
}
#button-monospace {
background-image: url('data:image/svg+xml;utf8,');
background-image: url('../img/icons/monospace.png');
}
#button-mark {
background-image: url('../img/icons/mark.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M17.75 7L14 3.25 4.15 13.1c-.1.1-.15.22-.15.36v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.75 7zm2.96-2.96c.39-.39.39-1.02 0-1.41L18.37.29c-.39-.39-1.02-.39-1.41 0L15 2.25 18.75 6l1.96-1.96z"/><path d="M2 20h20c1.1 0 2 .9 2 2s-.9 2-2 2H2c-1.1 0-2-.9-2-2s.9-2 2-2z" fill-opacity=".36"/></svg>');
}
#button-wiki-link {
background-image: url('../img/icons/wikilink.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>');
}
#button-external-link {
background-image: url('../img/icons/link.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>');
}
#button-user-link {
background-image: url('../img/icons/user.png');
// TODO in own file user.svg?
background-image: url('data:image/svg+xml;utf8,<svg version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><circle cx="12" cy="7.0236" r="4.9256" stroke-width="1.2314"/><path d="m12 14.412c-3.2878 0-9.8512 1.6501-9.8512 4.9256v2.4628h19.702v-2.4628c0-3.2755-6.5633-4.9256-9.8512-4.9256z" stroke-width="1.2314"/></svg>');
}
#button-quote {
background-image: url('../img/icons/quote.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"/></svg>');
}
#button-pre {
background-image: url('../img/icons/pre.png');
background-image: url('../img/icons/code.svg');
}
#button-picture {
background-image: url('../img/icons/picture.png');
}
#button-color {
background-image: url('../img/icons/color.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/></svg>');
}
#button-smilies {
background-image: url('../img/icons/smiley.png');
}
#button-date {
background-image: url('../img/icons/date.png');
}
#button-sig {
background-image: url('../img/icons/sig.png');
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"/></svg>');
}

.button_template(@button-text) {
Expand Down
3 changes: 3 additions & 0 deletions inyoka_theme_ubuntuusers/static/style/markup.less
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ div.moderated p, div.edited p {
/* custom 'emojis' that are not included in unicode and thus use a sprite */
span[class^='icon-'] {
display: inline-block;
height: 1ch;
width: 1ch;
background-repeat: no-repeat;
}
span {
&.icon-frog-xmas {
Expand Down
2 changes: 1 addition & 1 deletion inyoka_theme_ubuntuusers/static/style/wiki.less
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ table:not([class]), table[class^="zebra"] {

.navi_sidebar {
.navi_join {
background-image: url('../img/icons/code.png');
background-image: url('../img/icons/code.svg');
}
.navi_overview {
background-image: url('../img/icons/search.png');
Expand Down

0 comments on commit c18620e

Please sign in to comment.