Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 5fe4ddc

Browse files
har79nshahan
authored andcommitted
extract remaining settings and functions to css/_core.scss
Move: * mat-grid * mat-icon-images Move to client (only one client): * almost-{zero,one} Remove (unused): * export-once * mat-option-export-* Part of a sequence of CLs refactoring css/material into separate, smaller libraries PiperOrigin-RevId: 225357983
1 parent 3efa35f commit 5fe4ddc

File tree

3 files changed

+22
-61
lines changed

3 files changed

+22
-61
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// Grid
6+
$mat-grid: 8px;
7+
$mat-grid-type: 4px;
8+
9+
// Option that can be set before importing
10+
$mat-option-inline-icons: false !default;
11+
12+
// Creates a reference for the given file in either data or package url format,
13+
// depending on the value of the global variable $mat-option-inline-icons.
14+
@function mat-icon-image($file) {
15+
@if $mat-option-inline-icons {
16+
@return inline-image($file)
17+
} @else {
18+
@return url("package:#{$file}")
19+
}
20+
}

angular_components/lib/css/material/const/_functions.scss

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,4 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// #############################################################################
6-
//
7-
// WARNING: DO NOT IMPORT DIRECTLY OUTSIDE OF
8-
// THIRD_PARTY/DART_SRC/ACX/CSS/MATERIAL
9-
//
10-
// #############################################################################
11-
12-
13-
// It is not possible to place @imports within control statements. So we control
14-
// what css classes and extendable classes are visible through this directive
15-
// and a list.
16-
//
17-
// Usage for acx-example.scss:
18-
//
19-
// $variable: "Does not have to be within export-once";
20-
// @mixin also-can-be-outside() { }
21-
//
22-
// @include export-once('acx-unique-string-name') {
23-
// .class-you-only-want-imported-once { }
24-
// %partial-you-only-want-imported-once { }
25-
// }
26-
$export-list: () !default;
27-
28-
@mixin export-once($export-name) {
29-
@if (index($export-list, $export-name) == false) {
30-
$export-list: append($export-list, $export-name);
31-
@content;
32-
}
33-
}
34-
35-
// Creates a reference for the given file in either data or package url format,
36-
// depending on the value of the global variable $mat-option-inline-icons.
37-
@function mat-icon-image($file) {
38-
@if $mat-option-inline-icons {
39-
@return inline-image($file)
40-
} @else {
41-
@return url("package:#{$file}")
42-
}
43-
}
5+
@import 'package:angular_components/css/core';

angular_components/lib/css/material/const/_settings.scss

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// #############################################################################
6-
//
7-
// WARNING: DO NOT IMPORT DIRECTLY OUTSIDE OF
8-
// THIRD_PARTY/DART_SRC/ACX/CSS/MATERIAL
9-
//
10-
// #############################################################################
11-
5+
@import 'package:angular_components/css/core';
126
@import 'package:angular_components/css/transition_material';
137
@import 'package:angular_components/css/color_material';
14-
15-
// Options that can be set before importing
16-
$mat-option-inline-icons: false !default;
17-
$mat-option-export-classes: false !default;
18-
$mat-option-export-partials: false !default;
19-
20-
// Used because of an intermittent transition bug that sometimes causes opacity
21-
// transitions to not execute properly if opacity starts at exactly zero.
22-
$almost-zero: .0001;
23-
$almost-one: 1 - $almost-zero;
24-
25-
// Grid
26-
$mat-grid: 8px;
27-
$mat-grid-type: 4px;
28-

0 commit comments

Comments
 (0)