style the fake icon
When no icon is provided, we use the first two letters as icon. A fancy border makes it look more like an icon.
This commit is contained in:
parent
f293a16b9c
commit
285c4f96a7
2 changed files with 25 additions and 1 deletions
|
@ -35,6 +35,24 @@
|
|||
margin-right: @margin-small;
|
||||
color: @color-nav;
|
||||
|
||||
// simple fake icon
|
||||
strong {
|
||||
display: inline-block;
|
||||
font-size: @icon-size * 0.5;
|
||||
width: @icon-size * 0.9;
|
||||
height: @icon-size * 0.9;
|
||||
line-height: @icon-size * 0.9;
|
||||
margin: @icon-size * 0.05;
|
||||
vertical-align: baseline;
|
||||
text-align: center;
|
||||
color: @color-nav;
|
||||
border: 1px solid @color-nav;
|
||||
border-top-left-radius: 50%;
|
||||
border-bottom-right-radius: 50%;
|
||||
|
||||
}
|
||||
|
||||
// real icon
|
||||
svg {
|
||||
width: @icon-size;
|
||||
height: @icon-size;
|
||||
|
@ -52,6 +70,11 @@
|
|||
color: @button_background;
|
||||
text-decoration: none;
|
||||
|
||||
span strong {
|
||||
color: @button_background;
|
||||
border-color: @button_background;
|
||||
}
|
||||
|
||||
span svg path {
|
||||
fill: @button_background;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@ jQuery(function () {
|
|||
const data = $me.text().split('@', 2);
|
||||
const text = data[0].trim();
|
||||
const $icon = jQuery('<span>')
|
||||
.text(text.substr(0, 1).toUpperCase() + text.substr(1, 1).toLowerCase());
|
||||
.text(text.substr(0, 1).toUpperCase() + text.substr(1, 1).toLowerCase())
|
||||
.wrapInner('<strong>');
|
||||
if (data[1]) {
|
||||
const src = data[1].trim();
|
||||
$icon.load(DOKU_BASE + 'lib/tpl/sprintdoc/svg.php?svg=' + src + '&e=1'); // directly embed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue