From a24cad1a1cdce76ae77af889181f20f6eb38b0c9 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Wed, 4 Jul 2018 11:19:45 +0200 Subject: Fix accessibility invert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/accessibility/css/themedark.scss | 2 +- .../lib/Controller/AccessibilityController.php | 2 +- apps/files/css/files.scss | 14 +++++------ apps/systemtags/css/systemtagsfilelist.css | 27 ---------------------- apps/systemtags/css/systemtagsfilelist.scss | 27 ++++++++++++++++++++++ core/css/apps.scss | 2 +- lib/private/Template/IconsCacher.php | 4 ++-- lib/private/legacy/util.php | 11 +++++++-- 8 files changed, 48 insertions(+), 41 deletions(-) delete mode 100644 apps/systemtags/css/systemtagsfilelist.css create mode 100644 apps/systemtags/css/systemtagsfilelist.scss diff --git a/apps/accessibility/css/themedark.scss b/apps/accessibility/css/themedark.scss index ecde4ec4c8a..fc33b333ce9 100644 --- a/apps/accessibility/css/themedark.scss +++ b/apps/accessibility/css/themedark.scss @@ -45,7 +45,7 @@ $color-border-dark: lighten($color-main-background, 14%); } // since svg icons are inverted, revert to white for the header -#header-right > * { +.header-right > * { [class^='icon-'], [class*=' icon-'] { filter: invert(100%); } diff --git a/apps/accessibility/lib/Controller/AccessibilityController.php b/apps/accessibility/lib/Controller/AccessibilityController.php index 3ef305511e0..fa82f17e9d4 100644 --- a/apps/accessibility/lib/Controller/AccessibilityController.php +++ b/apps/accessibility/lib/Controller/AccessibilityController.php @@ -218,6 +218,6 @@ class AccessibilityController extends Controller { * @return string */ private function invertSvgIconsColor(string $css) { - return str_replace(['/000', '/fff'], ['/fff', '/000'], $css); + return str_replace(['/000', '/fff', '/***'], ['/***', '/000', '/fff'], $css); } } diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss index 6dcdec0711c..36ccd6cd258 100644 --- a/apps/files/css/files.scss +++ b/apps/files/css/files.scss @@ -84,26 +84,26 @@ /* icons for sidebar */ .nav-icon-files { - @include icon-color(folder, 'files', $color-black); + @include icon-color('folder', 'files', $color-black); } .nav-icon-recent { - @include icon-color(recent, 'files', $color-black); + @include icon-color('recent', 'files', $color-black); } .nav-icon-favorites { - @include icon-color(star, 'files', $color-black); + @include icon-color('star-dark', 'files', $color-black); } .nav-icon-sharingin, .nav-icon-sharingout { - @include icon-color(share, 'files', $color-black); + @include icon-color('share', 'files', $color-black); } .nav-icon-sharinglinks { - @include icon-color(public, 'files', $color-black); + @include icon-color('public', 'files', $color-black); } .nav-icon-extstoragemounts { - @include icon-color(external, 'files', $color-black); + @include icon-color('external', 'files', $color-black); } .nav-icon-trashbin { - @include icon-color(delete, 'files', $color-black); + @include icon-color('delete', 'files', $color-black); } .nav-icon-deletedshares { background-image: url('../img/unshare.svg?v=1'); diff --git a/apps/systemtags/css/systemtagsfilelist.css b/apps/systemtags/css/systemtagsfilelist.css deleted file mode 100644 index ad711f74733..00000000000 --- a/apps/systemtags/css/systemtagsfilelist.css +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2016 - * - * This file is licensed under the Affero General Public License version 3 - * or later. - * - * See the COPYING-README file. - * - */ -#app-content-systemtagsfilter .select2-container { - width: 30%; - margin-left: 10px; -} - -.nav-icon-systemtagsfilter { - background-image: url('../img/tag.svg'); -} - -#app-sidebar .mainFileInfoView .tag-label { - cursor: pointer; - padding: 13px; -} - -#app-sidebar .mainFileInfoView .icon-tag { - opacity: .5; - vertical-align: middle; -} diff --git a/apps/systemtags/css/systemtagsfilelist.scss b/apps/systemtags/css/systemtagsfilelist.scss new file mode 100644 index 00000000000..3c188e76449 --- /dev/null +++ b/apps/systemtags/css/systemtagsfilelist.scss @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2016 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ +#app-content-systemtagsfilter .select2-container { + width: 30%; + margin-left: 10px; +} + +.nav-icon-systemtagsfilter { + @include icon-color('tag', 'systemtags', $color-black); +} + +#app-sidebar .mainFileInfoView .tag-label { + cursor: pointer; + padding: 13px; +} + +#app-sidebar .mainFileInfoView .icon-tag { + opacity: .5; + vertical-align: middle; +} diff --git a/core/css/apps.scss b/core/css/apps.scss index 6645b6868d5..4ca34ff9897 100644 --- a/core/css/apps.scss +++ b/core/css/apps.scss @@ -693,7 +693,7 @@ kbd { padding: 0; margin: 0; background-color: var(--color-main-background); - background-image: url('../img/actions/settings-dark.svg?v=1'); + @include icon-color('settings-dark', 'actions', $color-black, true); background-position: 14px center; background-repeat: no-repeat; box-shadow: none; diff --git a/lib/private/Template/IconsCacher.php b/lib/private/Template/IconsCacher.php index 79c4b9d8ec0..c4d073156f1 100644 --- a/lib/private/Template/IconsCacher.php +++ b/lib/private/Template/IconsCacher.php @@ -45,7 +45,7 @@ class IconsCacher { protected $urlGenerator; /** @var string */ - private $iconVarRE = '/--([a-z0-9-]+): url\(["\']([a-z0-9-\/]+)[^;]+;/m'; + private $iconVarRE = '/--(icon-[a-z0-9-]+): url\(["\']([a-z0-9-\/]+)[^;]+;/m'; /** @var string */ private $fileName = 'icons-vars.css'; @@ -140,7 +140,7 @@ class IconsCacher { } } $linkToCSS = substr($this->urlGenerator->linkToRoute('core.Css.getCss', ['appName' => 'icons', 'fileName' => $this->fileName]), strlen(\OC::$WEBROOT)); - \OCP\Util::addHeader('link', ['rel' => 'stylesheet', 'href' => $linkToCSS]); + \OC_Util::addHeader('link', ['rel' => 'stylesheet', 'href' => $linkToCSS], null, true); } } \ No newline at end of file diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index ab595d885cb..5e9a46d44a9 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -687,13 +687,20 @@ class OC_Util { * @param string $tag tag name of the element * @param array $attributes array of attributes for the element * @param string $text the text content for the element + * @param bool $prepend prepend the header to the beginning of the list */ - public static function addHeader($tag, $attributes, $text=null) { - self::$headers[] = array( + public static function addHeader($tag, $attributes, $text = null, $prepend = false) { + $header = array( 'tag' => $tag, 'attributes' => $attributes, 'text' => $text ); + if ($prepend === true) { + array_unshift (self::$headers, $header); + + } else { + self::$headers[] = $header; + } } /** -- cgit v1.2.3