From 84bf883a47b956865d31b1b618d5495fcd7d4876 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 19 Aug 2017 09:47:05 -0700 Subject: v1.4.7 (#195) * Add try catch (#179) * Add checks before injections (#180) * Enhancement/url redirect manager (#182) * Initial blacklist * Move js checks to java * Optimize imports and clean up request interceptor * Misc (#190) * Update play store description * Finalize description * Update kotlin and bg2 for custom themes * Update to Android Studio 3.0 beta 2 * Update test dependencies and add logging to image activity * Rename throwable to errorRef * Update searchview and media picker through kau * Update themes (#183) * Theme content now found view * Update verified bg and bg2 for transparent themes * Fix check in star text * Various fixes * Create base svg sass images * Feature/theme accent (#192) * Add lots of theming components * Optimize and add * Update accents * Misc 2 (#191) * Add further checks for iab and remove generic error dialog * Theme all snackbars * Add dynamic media action tile * Enhancement/media-camera-picker (#194) * Update kau * Update changelog --- app/src/main/assets/css/core/_base.scss | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'app/src/main/assets/css/core/_base.scss') diff --git a/app/src/main/assets/css/core/_base.scss b/app/src/main/assets/css/core/_base.scss index a715d8bc..de625fa6 100644 --- a/app/src/main/assets/css/core/_base.scss +++ b/app/src/main/assets/css/core/_base.scss @@ -33,3 +33,74 @@ @content; } } + +// SVG optimization thanks to https://codepen.io/jakob-e/pen/doMoML +// Function to create an optimized svg url +// Version: 1.0.6 +@function svg-url($svg) { + // + // Add missing namespace + // + @if not str-index($svg, xmlns) { + $svg: str-replace($svg, "", "%3E"); + + // + // The maybe list + // + // Keep size and compile time down + // ... only add on documented fail + // + // $chunk: str-replace($chunk, '&', '%26'); + // $chunk: str-replace($chunk, '|', '%7C'); + // $chunk: str-replace($chunk, '[', '%5B'); + // $chunk: str-replace($chunk, ']', '%5D'); + // $chunk: str-replace($chunk, '^', '%5E'); + // $chunk: str-replace($chunk, '`', '%60'); + // $chunk: str-replace($chunk, ';', '%3B'); + // $chunk: str-replace($chunk, '?', '%3F'); + // $chunk: str-replace($chunk, ':', '%3A'); + // $chunk: str-replace($chunk, '@', '%40'); + // $chunk: str-replace($chunk, '=', '%3D'); + + $encoded: #{$encoded}#{$chunk}; + $index: $index + $slice; + } + + @return url("data:image/svg+xml,#{$encoded}"); +} + +// Background svg mixin +@mixin background-svg($svg, $extra: "no-repeat") { + background: svg-url($svg) unquote($extra) !important; +} + +// Helper function to replace characters in a string +@function str-replace($string, $search, $replace: "") { + $index: str-index($string, $search); + + @return if($index, str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace), $string); +} -- cgit v1.2.3