Skip to content

Commit 27c932a

Browse files
authored
Merge pull request #24910 from nextcloud/dependachristoph/composer/scss-1.4.0
Bump scssphp/scssphp from 1.0.3 to 1.4.0
2 parents d0fdc6e + a2f024a commit 27c932a

File tree

5 files changed

+59
-54
lines changed

5 files changed

+59
-54
lines changed

3rdparty

Submodule 3rdparty updated 44 files

core/css/css-variables.scss

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,55 @@
33
// All css4 variables must be fixed! Scss is a PRE processor
44
// css4 variables are processed after scss!
55
:root {
6-
--color-main-text: $color-main-text;
7-
--color-main-background: $color-main-background;
8-
--color-main-background-translucent: $color-main-background-translucent;
6+
--color-main-text: #{$color-main-text};
7+
--color-main-background: #{$color-main-background};
8+
--color-main-background-translucent: #{$color-main-background-translucent};
99

10-
--color-background-hover: $color-background-hover;
11-
--color-background-dark: $color-background-dark;
12-
--color-background-darker: $color-background-darker;
10+
--color-background-hover: #{$color-background-hover};
11+
--color-background-dark: #{$color-background-dark};
12+
--color-background-darker: #{$color-background-darker};
1313

14-
--color-placeholder-light: $color-placeholder-light;
15-
--color-placeholder-dark: $color-placeholder-dark;
14+
--color-placeholder-light: #{$color-placeholder-light};
15+
--color-placeholder-dark: #{$color-placeholder-dark};
1616

17-
--color-primary: $color-primary;
18-
--color-primary-light: $color-primary-light;
19-
--color-primary-text: $color-primary-text;
20-
--color-primary-text-dark: $color-primary-text-dark;
21-
--color-primary-element: $color-primary-element;
22-
--color-primary-element-light: $color-primary-element-light;
17+
--color-primary: #{$color-primary};
18+
--color-primary-light: #{$color-primary-light};
19+
--color-primary-text: #{$color-primary-text};
20+
--color-primary-text-dark: #{$color-primary-text-dark};
21+
--color-primary-element: #{$color-primary-element};
22+
--color-primary-element-light: #{$color-primary-element-light};
2323

24-
--color-error: $color-error;
25-
--color-warning: $color-warning;
26-
--color-success: $color-success;
24+
--color-error: #{$color-error};
25+
--color-warning: #{$color-warning};
26+
--color-success: #{$color-success};
2727

28-
--color-text-maxcontrast: $color-text-maxcontrast;
29-
--color-text-light: $color-main-text;
30-
--color-text-lighter: $color-text-maxcontrast;
28+
--color-text-maxcontrast: #{$color-text-maxcontrast};
29+
--color-text-light: #{$color-main-text};
30+
--color-text-lighter: #{$color-text-maxcontrast};
3131

32-
--image-logo: $image-logo;
33-
--image-login-background: $image-login-background;
34-
--image-logoheader: $image-logoheader;
35-
--image-favicon: $image-favicon;
32+
--image-logo: #{$image-logo};
33+
--image-login-background: #{$image-login-background};
34+
--image-logoheader: #{$image-logoheader};
35+
--image-favicon: #{$image-favicon};
3636

37-
--color-loading-light: $color-loading-light;
38-
--color-loading-dark: $color-loading-dark;
37+
--color-loading-light: #{$color-loading-light};
38+
--color-loading-dark: #{$color-loading-dark};
3939

40-
--color-box-shadow: $color-box-shadow;
40+
--color-box-shadow: #{$color-box-shadow};
4141

42-
--color-border: $color-border;
43-
--color-border-dark: $color-border-dark;
44-
--border-radius: $border-radius;
45-
--border-radius-large: $border-radius-large;
46-
--border-radius-pill: $border-radius-pill;
42+
--color-border: #{$color-border};
43+
--color-border-dark: #{$color-border-dark};
44+
--border-radius: #{$border-radius};
45+
--border-radius-large: #{$border-radius-large};
46+
--border-radius-pill: #{$border-radius-pill};
4747

48-
--font-face: $font-face;
49-
--default-font-size: $default-font-size;
48+
--font-face: #{$font-face};
49+
--default-font-size: #{$default-font-size};
5050

51-
--default-line-height: $default-line-height;
51+
--default-line-height: #{$default-line-height};
5252

53-
--animation-quick: $animation-quick;
54-
--animation-slow: $animation-slow;
53+
--animation-quick: #{$animation-quick};
54+
--animation-slow: #{$animation-slow};
5555

56-
--header-height: $header-height;
56+
--header-height: #{$header-height};
5757
}

core/css/functions.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* @return string The color without #
2828
*/
2929
@function remove-hash-from-color($color) {
30+
$color: unquote($color);
3031
$index: str-index(inspect($color), '#');
3132
@if $index {
3233
$color: str-slice(inspect($color), 2);

lib/private/Template/SCSSCacher.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
use OCP\IURLGenerator;
4848
use ScssPhp\ScssPhp\Compiler;
4949
use ScssPhp\ScssPhp\Exception\ParserException;
50-
use ScssPhp\ScssPhp\Formatter\Crunched;
51-
use ScssPhp\ScssPhp\Formatter\Expanded;
50+
use ScssPhp\ScssPhp\OutputStyle;
5251

5352
class SCSSCacher {
5453

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

315314
// Continue after throw
316-
$scss->setIgnoreErrors(true);
317315
if ($this->config->getSystemValue('debug')) {
318316
// Debug mode
319-
$scss->setFormatter(Expanded::class);
320-
$scss->setLineNumberStyle(Compiler::LINE_COMMENTS);
317+
$scss->setOutputStyle(OutputStyle::EXPANDED);
321318
} else {
322319
// Compression
323-
$scss->setFormatter(Crunched::class);
320+
$scss->setOutputStyle(OutputStyle::COMPRESSED);
324321
}
325322

326323
try {
@@ -391,8 +388,8 @@ public function resetCache() {
391388
$this->injectedVariables = null;
392389

393390
// do not clear locks
394-
$this->cacheFactory->createDistributed('SCSS-deps-')->clear();
395-
$this->cacheFactory->createDistributed('SCSS-cached-')->clear();
391+
$this->depsCache->clear();
392+
$this->isCachedCache->clear();
396393

397394
$appDirectory = $this->appData->getDirectoryListing();
398395
foreach ($appDirectory as $folder) {

tests/lib/Template/SCSSCacherTest.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class SCSSCacherTest extends \Test\TestCase {
5656
/** @var ICache|\PHPUnit\Framework\MockObject\MockObject */
5757
protected $depsCache;
5858
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
59+
protected $isCachedCache;
60+
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
5961
protected $cacheFactory;
6062
/** @var IconsCacher|\PHPUnit\Framework\MockObject\MockObject */
6163
protected $iconsCacher;
@@ -88,9 +90,15 @@ protected function setUp(): void {
8890
}));
8991
$this->cacheFactory = $this->createMock(ICacheFactory::class);
9092
$this->depsCache = $this->createMock(ICache::class);
91-
$this->cacheFactory->expects($this->at(0))
93+
$this->isCachedCache = $this->createMock(ICache::class);
94+
$this->cacheFactory
9295
->method('createDistributed')
93-
->willReturn($this->depsCache);
96+
->withConsecutive()
97+
->willReturnOnConsecutiveCalls(
98+
$this->depsCache,
99+
$this->isCachedCache,
100+
$this->createMock(ICache::class)
101+
);
94102

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

540-
$cache = $this->createMock(ICache::class);
541-
$this->cacheFactory->expects($this->exactly(2))
542-
->method('createDistributed')
543-
->willReturn($cache);
544-
$cache->expects($this->exactly(2))
548+
$this->depsCache->expects($this->once())
549+
->method('clear')
550+
->with('');
551+
$this->isCachedCache->expects($this->once())
545552
->method('clear')
546553
->with('');
547554
$this->appData->expects($this->once())

0 commit comments

Comments
 (0)