Skip to content

Commit

Permalink
Merge pull request #24910 from nextcloud/dependachristoph/composer/sc…
Browse files Browse the repository at this point in the history
…ss-1.4.0

Bump scssphp/scssphp from 1.0.3 to 1.4.0
  • Loading branch information
MorrisJobke authored Jan 11, 2021
2 parents d0fdc6e + a2f024a commit 27c932a
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 54 deletions.
2 changes: 1 addition & 1 deletion 3rdparty
Submodule 3rdparty updated 44 files
+1 −1 composer.json
+17 −9 composer.lock
+9 −9 composer/InstalledVersions.php
+4 −1 composer/autoload_classmap.php
+4 −1 composer/autoload_static.php
+17 −9 composer/installed.json
+9 −9 composer/installed.php
+2 −2 composer/package-versions-deprecated/src/PackageVersions/Versions.php
+10 −10 scssphp/scssphp/README.md
+30 −13 scssphp/scssphp/composer.json
+12 −0 scssphp/scssphp/phpcs.xml.dist
+5 −0 scssphp/scssphp/scss.inc.php
+2 −1 scssphp/scssphp/src/Base/Range.php
+3 −2 scssphp/scssphp/src/Block.php
+19 −16 scssphp/scssphp/src/Cache.php
+75 −9 scssphp/scssphp/src/Colors.php
+3,158 −1,149 scssphp/scssphp/src/Compiler.php
+2 −1 scssphp/scssphp/src/Compiler/Environment.php
+3 −2 scssphp/scssphp/src/Exception/CompilerException.php
+29 −2 scssphp/scssphp/src/Exception/ParserException.php
+3 −2 scssphp/scssphp/src/Exception/RangeException.php
+7 −0 scssphp/scssphp/src/Exception/SassException.php
+32 −0 scssphp/scssphp/src/Exception/SassScriptException.php
+3 −2 scssphp/scssphp/src/Exception/ServerException.php
+85 −34 scssphp/scssphp/src/Formatter.php
+6 −1 scssphp/scssphp/src/Formatter/Compact.php
+2 −2 scssphp/scssphp/src/Formatter/Compressed.php
+6 −2 scssphp/scssphp/src/Formatter/Crunched.php
+6 −2 scssphp/scssphp/src/Formatter/Debug.php
+3 −3 scssphp/scssphp/src/Formatter/Expanded.php
+41 −19 scssphp/scssphp/src/Formatter/Nested.php
+3 −2 scssphp/scssphp/src/Formatter/OutputBlock.php
+2 −1 scssphp/scssphp/src/Node.php
+524 −117 scssphp/scssphp/src/Node/Number.php
+9 −0 scssphp/scssphp/src/OutputStyle.php
+1,457 −432 scssphp/scssphp/src/Parser.php
+2 −1 scssphp/scssphp/src/SourceMap/Base64.php
+18 −6 scssphp/scssphp/src/SourceMap/Base64VLQ.php
+0 −217 scssphp/scssphp/src/SourceMap/Base64VLQEncoder.php
+30 −11 scssphp/scssphp/src/SourceMap/SourceMapGenerator.php
+7 −1 scssphp/scssphp/src/Type.php
+112 −1 scssphp/scssphp/src/Util.php
+77 −0 scssphp/scssphp/src/Util/Path.php
+3 −2 scssphp/scssphp/src/Version.php
76 changes: 38 additions & 38 deletions core/css/css-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,55 @@
// All css4 variables must be fixed! Scss is a PRE processor
// css4 variables are processed after scss!
:root {
--color-main-text: $color-main-text;
--color-main-background: $color-main-background;
--color-main-background-translucent: $color-main-background-translucent;
--color-main-text: #{$color-main-text};
--color-main-background: #{$color-main-background};
--color-main-background-translucent: #{$color-main-background-translucent};

--color-background-hover: $color-background-hover;
--color-background-dark: $color-background-dark;
--color-background-darker: $color-background-darker;
--color-background-hover: #{$color-background-hover};
--color-background-dark: #{$color-background-dark};
--color-background-darker: #{$color-background-darker};

--color-placeholder-light: $color-placeholder-light;
--color-placeholder-dark: $color-placeholder-dark;
--color-placeholder-light: #{$color-placeholder-light};
--color-placeholder-dark: #{$color-placeholder-dark};

--color-primary: $color-primary;
--color-primary-light: $color-primary-light;
--color-primary-text: $color-primary-text;
--color-primary-text-dark: $color-primary-text-dark;
--color-primary-element: $color-primary-element;
--color-primary-element-light: $color-primary-element-light;
--color-primary: #{$color-primary};
--color-primary-light: #{$color-primary-light};
--color-primary-text: #{$color-primary-text};
--color-primary-text-dark: #{$color-primary-text-dark};
--color-primary-element: #{$color-primary-element};
--color-primary-element-light: #{$color-primary-element-light};

--color-error: $color-error;
--color-warning: $color-warning;
--color-success: $color-success;
--color-error: #{$color-error};
--color-warning: #{$color-warning};
--color-success: #{$color-success};

--color-text-maxcontrast: $color-text-maxcontrast;
--color-text-light: $color-main-text;
--color-text-lighter: $color-text-maxcontrast;
--color-text-maxcontrast: #{$color-text-maxcontrast};
--color-text-light: #{$color-main-text};
--color-text-lighter: #{$color-text-maxcontrast};

--image-logo: $image-logo;
--image-login-background: $image-login-background;
--image-logoheader: $image-logoheader;
--image-favicon: $image-favicon;
--image-logo: #{$image-logo};
--image-login-background: #{$image-login-background};
--image-logoheader: #{$image-logoheader};
--image-favicon: #{$image-favicon};

--color-loading-light: $color-loading-light;
--color-loading-dark: $color-loading-dark;
--color-loading-light: #{$color-loading-light};
--color-loading-dark: #{$color-loading-dark};

--color-box-shadow: $color-box-shadow;
--color-box-shadow: #{$color-box-shadow};

--color-border: $color-border;
--color-border-dark: $color-border-dark;
--border-radius: $border-radius;
--border-radius-large: $border-radius-large;
--border-radius-pill: $border-radius-pill;
--color-border: #{$color-border};
--color-border-dark: #{$color-border-dark};
--border-radius: #{$border-radius};
--border-radius-large: #{$border-radius-large};
--border-radius-pill: #{$border-radius-pill};

--font-face: $font-face;
--default-font-size: $default-font-size;
--font-face: #{$font-face};
--default-font-size: #{$default-font-size};

--default-line-height: $default-line-height;
--default-line-height: #{$default-line-height};

--animation-quick: $animation-quick;
--animation-slow: $animation-slow;
--animation-quick: #{$animation-quick};
--animation-slow: #{$animation-slow};

--header-height: $header-height;
--header-height: #{$header-height};
}
1 change: 1 addition & 0 deletions core/css/functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @return string The color without #
*/
@function remove-hash-from-color($color) {
$color: unquote($color);
$index: str-index(inspect($color), '#');
@if $index {
$color: str-slice(inspect($color), 2);
Expand Down
13 changes: 5 additions & 8 deletions lib/private/Template/SCSSCacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
use OCP\IURLGenerator;
use ScssPhp\ScssPhp\Compiler;
use ScssPhp\ScssPhp\Exception\ParserException;
use ScssPhp\ScssPhp\Formatter\Crunched;
use ScssPhp\ScssPhp\Formatter\Expanded;
use ScssPhp\ScssPhp\OutputStyle;

class SCSSCacher {

Expand Down Expand Up @@ -313,14 +312,12 @@ private function cache(string $path, string $fileNameCSS, string $fileNameSCSS,
]);

// Continue after throw
$scss->setIgnoreErrors(true);
if ($this->config->getSystemValue('debug')) {
// Debug mode
$scss->setFormatter(Expanded::class);
$scss->setLineNumberStyle(Compiler::LINE_COMMENTS);
$scss->setOutputStyle(OutputStyle::EXPANDED);
} else {
// Compression
$scss->setFormatter(Crunched::class);
$scss->setOutputStyle(OutputStyle::COMPRESSED);
}

try {
Expand Down Expand Up @@ -391,8 +388,8 @@ public function resetCache() {
$this->injectedVariables = null;

// do not clear locks
$this->cacheFactory->createDistributed('SCSS-deps-')->clear();
$this->cacheFactory->createDistributed('SCSS-cached-')->clear();
$this->depsCache->clear();
$this->isCachedCache->clear();

$appDirectory = $this->appData->getDirectoryListing();
foreach ($appDirectory as $folder) {
Expand Down
21 changes: 14 additions & 7 deletions tests/lib/Template/SCSSCacherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class SCSSCacherTest extends \Test\TestCase {
/** @var ICache|\PHPUnit\Framework\MockObject\MockObject */
protected $depsCache;
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $isCachedCache;
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $cacheFactory;
/** @var IconsCacher|\PHPUnit\Framework\MockObject\MockObject */
protected $iconsCacher;
Expand Down Expand Up @@ -88,9 +90,15 @@ protected function setUp(): void {
}));
$this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->depsCache = $this->createMock(ICache::class);
$this->cacheFactory->expects($this->at(0))
$this->isCachedCache = $this->createMock(ICache::class);
$this->cacheFactory
->method('createDistributed')
->willReturn($this->depsCache);
->withConsecutive()
->willReturnOnConsecutiveCalls(
$this->depsCache,
$this->isCachedCache,
$this->createMock(ICache::class)
);

$this->themingDefaults = $this->createMock(ThemingDefaults::class);
$this->themingDefaults->expects($this->any())->method('getScssVariables')->willReturn([]);
Expand Down Expand Up @@ -537,11 +545,10 @@ public function testResetCache() {
->method('getDirectoryListing')
->willReturn([$file]);

$cache = $this->createMock(ICache::class);
$this->cacheFactory->expects($this->exactly(2))
->method('createDistributed')
->willReturn($cache);
$cache->expects($this->exactly(2))
$this->depsCache->expects($this->once())
->method('clear')
->with('');
$this->isCachedCache->expects($this->once())
->method('clear')
->with('');
$this->appData->expects($this->once())
Expand Down

0 comments on commit 27c932a

Please sign in to comment.