Skip to content

Commit

Permalink
spell "usercss" fully in write-as
Browse files Browse the repository at this point in the history
+ remove leftovers
  • Loading branch information
tophf committed Sep 9, 2023
1 parent 4f09e38 commit 53e3659
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 26 deletions.
10 changes: 10 additions & 0 deletions .icons/usercss.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions global-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
--cmin: hsl(0, 0%, 100%);
--cmax: hsl(0, 0%, 0%);
--accent-1: hsl(180, 100%, 95%);
--accent-2: hsl(180, 50%, 30%);
--accent-3: hsl(180, 30%, 18%);
--input-bg: var(--c95);
--red1: hsl(0, 85%, 55%);
Expand Down
7 changes: 4 additions & 3 deletions global.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
--cmax: hsl(0, 0%, 100%);
--bg: var(--c100);
--fg: var(--c00);
--accent-1: hsl(180, 100%, 15%);
--accent-1: hsl(180, 100%, 19%);
--accent-2: hsl(180, 50%, 40%);
--accent-3: hsl(180, 40%, 69%);
--red1: hsl(0, 70%, 45%);
Expand Down Expand Up @@ -452,7 +452,7 @@ body.resizing-v > * {
@font-face {
font-family: 'icons';
src: url(/icons.ttf) format('truetype');
unicode-range: /*AUTO-GENERATED-ICON-RANGE*/ U+20,U+2195,U+2197,U+21b2,U+21b6,U+22c1,U+22ee,U+24d8,U+25bc,U+25f4,U+2611,U+2699,U+270f,U+2713,U+2714,U+2716,U+2795,U+2796,U+27f3,U+e000;
unicode-range: /*AUTO-GENERATED-ICON-RANGE*/ U+20,U+2195,U+2197,U+21b2,U+21b6,U+222a,U+22c1,U+22ee,U+24d8,U+25bc,U+25f4,U+2611,U+2699,U+270f,U+2713,U+2714,U+2716,U+2795,U+2796,U+27f3,U+d83e;
}

/*AUTO-GENERATED-ICON*/ .i-check1::after { content: "✓"; }
Expand All @@ -470,7 +470,8 @@ body.resizing-v > * {
/*AUTO-GENERATED-ICON*/ .i-plus::after { content: "➕"; }
/*AUTO-GENERATED-ICON*/ .i-reorder::after { content: "↕"; }
/*AUTO-GENERATED-ICON*/ .i-select-arrow::after { content: "▼"; }
/*AUTO-GENERATED-ICON*/ .i-sort-down::after { content: ""; }
/*AUTO-GENERATED-ICON*/ .i-sort-down::after { content: "🠇"; }
/*AUTO-GENERATED-ICON*/ .i-usercss::after { content: "∪"; }
/*AUTO-GENERATED-ICON*/ .i-undo::after { content: "↶"; }
/*AUTO-GENERATED-ICON*/ .i-update-check::after { content: "⟳"; }
/*AUTO-GENERATED-ICON*/ .i-v::after { content: "⋁"; }
Binary file modified icons.ttf
Binary file not shown.
6 changes: 3 additions & 3 deletions manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2 class="style-name">
<template data-id="styleNewUI">
<div class="entry">
<h2 class="style-name">
<input class="checker" type="checkbox" i18n="title:toggleStyle">
<input type="checkbox" i18n="title:toggleStyle">
<a class="style-name-link">
&nbsp;
<span class="style-info" data-type="version"></span>
Expand Down Expand Up @@ -249,9 +249,9 @@ <h2 i18n="manageFilters">:
<a href="edit.html">
<button id="add-style-label" i18n="addStyleLabel" tabindex="-1"></button>
</a>
<label id="add-style-as-usercss-wrapper">
<label id="add-style-as-usercss-wrapper" i18n="title:optionsAdvancedNewStyleAsUsercss">
<input type="checkbox" id="newStyleAsUsercss">
<span i18n="manageNewStyleAsUsercss, title:optionsAdvancedNewStyleAsUsercss"></span>
<i class=i-usercss></i>
<a id="usercss-wiki"
class="icon"
href="https://github.com/openstyles/stylus/wiki/Usercss"
Expand Down
16 changes: 13 additions & 3 deletions manage/manage.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,30 @@ a:hover {
align-items: center;
flex-wrap: wrap;
}

#add-style-wrapper > * {
/* in case the children are wrapped */
margin-bottom: .5rem;
}

#header #add-style-as-usercss-wrapper {
display: flex;
align-items: center;
}

#add-style-as-usercss-wrapper:not(:hover) input:not(:checked) ~ a i {
color: var(--c65);
}
#newStyleAsUsercss + i {
font-size: 16px;
cursor: auto;
}
#newStyleAsUsercss:checked,
#newStyleAsUsercss:checked + i {
border-color: var(--accent-1);
color: var(--accent-1);
}
#newStyleAsUsercss:checked + i + a i {
color: var(--accent-2);
filter: grayscale(.75);
}

button.icon {
--w: 16px;
Expand Down
3 changes: 1 addition & 2 deletions manage/sorter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* global $ $create dom messageBoxProxy */// dom.js
/* global FIREFOX */// toolbox.js
/* global installed */// manage.js
/* global prefs */
/* global t */// localization.js
Expand Down Expand Up @@ -92,7 +91,7 @@ const sorter = (() => {
const option = $create('option');
const optgroup = $create('optgroup');
const meta = {
desc: ` ${FIREFOX ? '🠇' : '\uE000'}`,
desc: ` 🠇`,
enabled: t('genericEnabledLabel'),
disabled: t('genericDisabledLabel'),
dateNew: ` (${t('sortDateNewestFirst')})`,
Expand Down
4 changes: 2 additions & 2 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<div class="if-not-blocked">
<label id="write-as" i18n="title:optionsAdvancedNewStyleAsUsercss">
<input id="newStyleAsUsercss" type="checkbox">
<div>U</div>
<i class=i-usercss></i>
</label>
<div id="write-style">
<span id="write-style-for" i18n="writeStyleFor"></span>
Expand All @@ -150,7 +150,7 @@
menu-gf="GreasyFork"></button>
</div>
<button id="options-btn" i18n="title:openOptions" class="rel">
<svg class="if-not-blocked abs i-config" viewBox="0 0 20 20">
<svg class="if-not-blocked abs" viewBox="0 0 20 20">
<text y="100%"></text>
</svg>
<span class="if-not-blocked">&nbsp;</span>
Expand Down
26 changes: 15 additions & 11 deletions popup/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -413,24 +413,28 @@ a:hover i {
/* 'New style' links */
#write-style {
cursor: pointer;
line-height: 16px;
}
#newStyleAsUsercss ~ div {
font-weight: bold;
margin: 0 -1px 0;
padding: 1px 3px 0;
text-align: center;
border-radius: 4px;
position: absolute;
#write-as {
flex: 0;
}
#newStyleAsUsercss:checked ~ div {
color: var(--bg);
background-color: var(--accent-2);
#newStyleAsUsercss + i {
pointer-events: auto;
margin-left: -1px;
color: var(--c60);
}
#newStyleAsUsercss:checked,
#newStyleAsUsercss:checked + i {
border-color: var(--accent-1);
color: var(--accent-2);
}

.write-style-link {
margin-left: .6ex
}

.write-style-link:nth-last-child(2) {
font-weight: bold;
}
.about-blank > .breadcrumbs {
pointer-events: none;
}
Expand Down
1 change: 0 additions & 1 deletion popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ function createStyleElement(style) {
});
const styleName = $('.style-name', entry);
Object.assign(styleName, {
htmlFor: ENTRY_ID_PREFIX_RAW + style.id,
onclick: Events.name,
});
styleName.appendChild(document.createTextNode(' '));
Expand Down
3 changes: 2 additions & 1 deletion tools/build-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const SVG_MAP = Object.entries({
'plus': '➕',
'reorder': '↕',
'select-arrow': '▼',
'sort-down': '\uE000', // must be in PUA range because the symbol is used along with normal fonts
'sort-down': '🠇',
'usercss': '∪',
'undo': '↶',
'update-check': '⟳',
'v': '⋁',
Expand Down

0 comments on commit 53e3659

Please sign in to comment.