ng-configcat-publicapi-ui 6.0.2 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- @use 'sass:color';
2
- @use 'theme';
1
+ @use "sass:color";
2
+ @use "theme";
3
3
 
4
4
  $admonition-box-font-color: #2b2b2b;
5
5
 
@@ -23,8 +23,9 @@ $admonition-box-warn-border-color-dark: #ff910070;
23
23
  $admonition-box-error-background-color-dark: #fd38382c;
24
24
  $admonition-box-error-border-color-dark: #ff00005e;
25
25
 
26
- @mixin render-css-vars {
27
- :root {
26
+ /// @param {String} $scope-selector
27
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
28
+ #{$scope-selector} {
28
29
  --admonition-box-font-color: #{$admonition-box-font-color};
29
30
  --admonition-box-link-color: #{color.adjust(theme.$primary-color, $lightness: -6%)};
30
31
  --admonition-box-info-background-color: #{$admonition-box-info-background-color};
@@ -34,7 +35,9 @@ $admonition-box-error-border-color-dark: #ff00005e;
34
35
  --admonition-box-error-background-color: #{$admonition-box-error-background-color};
35
36
  --admonition-box-error-border-color: #{$admonition-box-error-border-color};
36
37
 
37
- [data-theme='dark'] {
38
+ &[data-theme="dark"],
39
+ [data-theme="dark"] &,
40
+ & [data-theme="dark"] {
38
41
  --admonition-box-font-color: #{$admonition-box-font-color-dark};
39
42
  --admonition-box-link-color: #{theme.$primary-color-dark};
40
43
  --admonition-box-info-background-color: #{$admonition-box-info-background-color-dark};
@@ -1,5 +1,6 @@
1
- @mixin render-css-vars {
2
- :root {
1
+ /// @param {String} $scope-selector
2
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
3
+ #{$scope-selector} {
3
4
  --config-overview-table-background-color: #f5f5f5;
4
5
  --config-overview-table-border-color: white;
5
6
  --config-overview-table-fullscreen-key-column-background: #303030;
@@ -19,7 +20,9 @@
19
20
  --config-overview-fullscreen-background-color: black;
20
21
  --config-overview-fullscreen-footer-color: white;
21
22
 
22
- [data-theme='dark'] {
23
+ &[data-theme="dark"],
24
+ [data-theme="dark"] &,
25
+ & [data-theme="dark"] {
23
26
  --config-overview-table-background-color: #30363d;
24
27
  --config-overview-table-border-color: #1b1f25;
25
28
  }
@@ -1,5 +1,6 @@
1
- @mixin render-css-vars {
2
- :root {
1
+ /// @param {String} $scope-selector
2
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
3
+ #{$scope-selector} {
3
4
  --flag-tutorial-background: #d9e8fa;
4
5
 
5
6
  --flag-box-background: #dee5f0;
@@ -73,7 +74,9 @@
73
74
  --save-separator-color: #ffffff56;
74
75
  --save-separator-disabled-color: #9c9c9c41;
75
76
 
76
- [data-theme="dark"] {
77
+ &[data-theme="dark"],
78
+ [data-theme="dark"] &,
79
+ & [data-theme="dark"] {
77
80
  --flag-tutorial-background: #3180ee23;
78
81
 
79
82
  --flag-box-background: #1f242b;
@@ -1,5 +1,6 @@
1
- @mixin render-css-vars {
2
- :root {
1
+ /// @param {String} $scope-selector
2
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
3
+ #{$scope-selector} {
3
4
  --header-text-color: white;
4
5
  --header-background-base: #f8912c;
5
6
  --header-background: linear-gradient(to right, var(--header-background-base), #f14321);
@@ -7,7 +8,9 @@
7
8
  --header-logo-cat-fill: #ed1c24;
8
9
  --header-dropdown-border-color: #ececec;
9
10
 
10
- [data-theme="dark"] {
11
+ &[data-theme="dark"],
12
+ [data-theme="dark"] &,
13
+ & [data-theme="dark"] {
11
14
  --header-background-base: #733a83;
12
15
  --header-background: linear-gradient(90deg, #af3356 0%, #8c3fa2 35%, #37359c 100%);
13
16
  --header-border-color: #30363d;
@@ -1,15 +1,18 @@
1
- @mixin render-css-vars {
2
- :root {
1
+ /// @param {String} $scope-selector
2
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
3
+ #{$scope-selector} {
3
4
  --info-icon-color: #7fb2ff;
4
5
  --warn-icon-color: #ff9900;
5
6
  --error-icon-color: red;
6
7
  --success-icon-color: #4caf50;
7
- --info-icon-content: '\e88e';
8
- --warn-icon-content: '\e002';
9
- --error-icon-content: '\e000';
10
- --success-icon-content: '\e86c';
8
+ --info-icon-content: "\e88e";
9
+ --warn-icon-content: "\e002";
10
+ --error-icon-content: "\e000";
11
+ --success-icon-content: "\e86c";
11
12
 
12
- [data-theme='dark'] {
13
+ &[data-theme="dark"],
14
+ [data-theme="dark"] &,
15
+ & [data-theme="dark"] {
13
16
  --info-icon-color: #6b9fee;
14
17
  --warn-icon-color: #ec8e00;
15
18
  --error-icon-color: #dd4848;
@@ -19,7 +22,7 @@
19
22
  }
20
23
 
21
24
  @mixin mat-icon {
22
- font-family: 'Material Icons';
25
+ font-family: "Material Icons";
23
26
  direction: ltr;
24
27
  display: inline-block;
25
28
  font-size: 24px;
@@ -1,5 +1,6 @@
1
- @mixin render-css-vars {
2
- :root {
1
+ /// @param {String} $scope-selector
2
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
3
+ #{$scope-selector} {
3
4
  --lang-logo-inactive-correction-filter-1: grayscale(1);
4
5
  --lang-logo-inactive-correction-filter-2: grayscale(1) brightness(200%);
5
6
  --lang-logo-inactive-correction-filter-3: grayscale(1) brightness(100%);
@@ -7,7 +8,9 @@
7
8
  --lang-logo-inactive-correction-filter-5: grayscale(1) brightness(50%);
8
9
  --lang-logo-inactive-correction-filter-6: grayscale(1) brightness(80%);
9
10
 
10
- [data-theme='dark'] {
11
+ &[data-theme="dark"],
12
+ [data-theme="dark"] &,
13
+ & [data-theme="dark"] {
11
14
  --lang-logo-inactive-correction-filter-1: grayscale(1);
12
15
  --lang-logo-inactive-correction-filter-2: grayscale(1) brightness(150%);
13
16
  --lang-logo-inactive-correction-filter-3: grayscale(1) brightness(200%);
@@ -10,8 +10,9 @@ $notification-box-info-color-dark: #48638a;
10
10
  $notification-box-warn-color-dark: #ac5d1c;
11
11
  $notification-box-error-color-dark: #9c2f2f;
12
12
 
13
- @mixin render-css-vars {
14
- :root {
13
+ /// @param {String} $scope-selector
14
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
15
+ #{$scope-selector} {
15
16
  --notification-font-color: #e3e3e3;
16
17
  --notification-success-background-color: #{$notification-box-success-color};
17
18
  --notification-info-background-color: #{$notification-box-info-color};
@@ -23,7 +24,9 @@ $notification-box-error-color-dark: #9c2f2f;
23
24
  --notification-warn-icon-color: #{color.adjust($notification-box-warn-color, $lightness: 33%)};
24
25
  --notification-error-icon-color: #{color.adjust($notification-box-error-color, $lightness: 28%)};
25
26
 
26
- [data-theme="dark"] {
27
+ &[data-theme="dark"],
28
+ [data-theme="dark"] &,
29
+ & [data-theme="dark"] {
27
30
  --notification-success-background-color: #{$notification-box-success-color-dark};
28
31
  --notification-info-background-color: #{$notification-box-info-color-dark};
29
32
  --notification-warn-background-color: #{$notification-box-warn-color-dark};
@@ -1,4 +1,4 @@
1
- @use 'sass:color';
1
+ @use "sass:color";
2
2
 
3
3
  $overview-box-text-color: #333;
4
4
  $overview-box-add-text-color: color.adjust($overview-box-text-color, $alpha: -0.4);
@@ -8,8 +8,9 @@ $overview-box-text-color-dark: #cacaca;
8
8
  $overview-box-add-text-color-dark: color.adjust($overview-box-text-color-dark, $alpha: -0.4);
9
9
  $overview-box-add-text-disabled-color-dark: color.adjust($overview-box-text-color-dark, $alpha: -0.7);
10
10
 
11
- @mixin render-css-vars {
12
- :root {
11
+ /// @param {String} $scope-selector
12
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
13
+ #{$scope-selector} {
13
14
  --overview-box-background-color: var(--panel-content-box-background-color);
14
15
  --overview-box-config-header-color: #ddebf8;
15
16
  --overview-box-config-header-hover-color: #b9d4ef;
@@ -28,7 +29,9 @@ $overview-box-add-text-disabled-color-dark: color.adjust($overview-box-text-colo
28
29
  --overview-box-product-header-circle-background-color: #2a9d8f;
29
30
  --overview-box-status-text-color: gray;
30
31
 
31
- [data-theme='dark'] {
32
+ &[data-theme="dark"],
33
+ [data-theme="dark"] &,
34
+ & [data-theme="dark"] {
32
35
  --overview-box-background-color: #242931;
33
36
  --overview-box-config-header-color: #333a44;
34
37
  --overview-box-config-header-hover-color: #3c4450;
@@ -1,10 +1,11 @@
1
- @use 'sass:color';
1
+ @use "sass:color";
2
2
 
3
3
  $prism-background: #f6f8fa;
4
4
  $prism-background-dark: #20262c;
5
5
 
6
- @mixin render-css-vars {
7
- :root {
6
+ /// @param {String} $scope-selector
7
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
8
+ #{$scope-selector} {
8
9
  --prism-foreground: #111b27;
9
10
  --prism-background: #{$prism-background};
10
11
  --prism-selection: #8da1b9;
@@ -22,7 +23,9 @@ $prism-background-dark: #20262c;
22
23
  --prism-line-number-foreground: #8da1b9da;
23
24
  --prism-line-number-separator: #{color.adjust($prism-background, $lightness: -10%)};
24
25
 
25
- [data-theme='dark'] {
26
+ &[data-theme="dark"],
27
+ [data-theme="dark"] &,
28
+ & [data-theme="dark"] {
26
29
  --prism-foreground: #e3eaf2;
27
30
  --prism-background: #{$prism-background-dark};
28
31
  --prism-selection: #3c526d;
@@ -1,5 +1,6 @@
1
- @mixin render-css-vars {
2
- :root {
1
+ /// @param {String} $scope-selector
2
+ @mixin render-css-vars($scope-selector: ".ng-configcat-publicapi-ui-scope") {
3
+ #{$scope-selector} {
3
4
  --sidenav-background-color: #1d2227;
4
5
  --sidenav-text-color: #dfdfdf;
5
6
  --sidenav-border-color: #2f343a;
@@ -19,7 +20,9 @@
19
20
  --sidenav-cello-badge-text-color: white;
20
21
  --sidenav-right-border: none;
21
22
 
22
- [data-theme='dark'] {
23
+ &[data-theme="dark"],
24
+ [data-theme="dark"] &,
25
+ & [data-theme="dark"] {
23
26
  --sidenav-background-color: #15191d;
24
27
  --sidenav-text-color: #ececec;
25
28
  --sidenav-border-color: #24272c;
@@ -1,49 +1,57 @@
1
- @use "sass:meta";
2
- /* You can add global styles to this file, and also import other style files */
3
-
4
1
  @use "@angular/material" as mat;
5
2
  @use "./css/variables.scss";
6
3
  @use "./css/theme.scss";
4
+ @use "./css/table.scss";
5
+ @use "./css/controls.scss";
6
+ @use "./css/dialog.scss";
7
+ @use "./css/tooltip.scss";
8
+ @use "./css/button.scss";
9
+ @use "./css/snackbar.scss";
10
+ @use "./css/icon.scss";
11
+ @use "./css/variation.scss";
12
+
13
+ /*
14
+ By default, styles are applied globally.
15
+ To scope them instead, opt in from your Angular host app's styles.scss:
16
+
17
+ @use "ng-configcat-publicapi-ui/src/public-api" as ng-configcat-publicapi-ui with ($global-styles: false);
18
+
19
+ @include ng-configcat-publicapi-ui.apply-ng-configcat-publicapi-ui-styles(".ng-configcat-publicapi-ui-scope, .ng-configcat-publicapi-ui-overlay");
20
+
21
+ Wrap the package components in an element with the scope class.
22
+ Dialogs, menus, etc. open in an Angular CDK overlay outside that element, so give them the
23
+ overlay class, e.g. panelClass: "ng-configcat-publicapi-ui-overlay".
24
+ */
25
+
26
+ $global-styles: true !default;
27
+
28
+ /// @param {String} $scope-selector
29
+ @mixin apply-ng-configcat-publicapi-ui-styles($scope-selector: ".ng-configcat-publicapi-ui-scope") {
30
+ // 1. Material theme, then densities, then CSS variables
31
+ @include theme.apply-package-core-theme($scope-selector);
32
+
33
+ #{$scope-selector} {
34
+ @include mat.button-density(0);
35
+ @include mat.icon-button-density(-2);
36
+ @include mat.form-field-density(-2);
37
+ @include mat.checkbox-density(-3);
38
+ }
7
39
 
8
- @include mat.button-density(0);
9
- @include mat.icon-button-density(-2);
10
- @include mat.form-field-density(-2);
11
- @include mat.checkbox-density(-3);
12
-
13
- @include meta.load-css("./css/table.scss");
14
- @include meta.load-css("./css/controls.scss");
15
- @include meta.load-css("css/dialog.scss");
16
- @include meta.load-css("css/tooltip.scss");
17
- @include meta.load-css("./css/button.scss");
18
- @include meta.load-css("./css/snackbar.scss");
19
- @include meta.load-css("./css/icon.scss");
20
- @include meta.load-css("./css/variation.scss");
21
-
22
- html {
23
- overflow: -moz-scrollbars-vertical;
24
- overflow-y: scroll;
25
-
26
- body {
27
- margin: 0;
28
- color-scheme: var(--color-scheme);
29
- font-family: Montserrat, Roboto, "Helvetica Neue", sans-serif;
30
- font-size: 13px;
31
- background-color: var(--page-background-color);
32
- color: var(--text-color);
33
-
34
- a {
35
- color: var(--link-color);
36
- text-decoration: none;
37
- }
38
-
39
- h3 {
40
- font-weight: 700;
41
- }
42
-
43
- .mat-mdc-standard-chip .mdc-evolution-chip__text-label {
44
- font-size: 12px;
45
- }
46
-
40
+ @include variables.apply-package-variables-theme($scope-selector);
41
+
42
+ // 2. Component styles
43
+ @include table.apply-table-theme($scope-selector);
44
+ @include controls.apply-form-field-theme($scope-selector);
45
+ @include dialog.apply-dialog-theme($scope-selector);
46
+ @include tooltip.apply-tooltip-theme($scope-selector);
47
+ @include button.apply-button-theme($scope-selector);
48
+ @include snackbar.apply-snackbar-theme($scope-selector);
49
+ @include icon.apply-icon-theme($scope-selector);
50
+ @include variation.apply-variation-theme($scope-selector);
51
+
52
+ // 3. Overlay menu styles (menus render in cdk-overlay-container, outside the scope)
53
+ // `html > body` keeps the specificity high enough to win over Material's own styles.
54
+ html > body {
47
55
  .hide-menu-overflow-text {
48
56
  .mat-mdc-menu-item-text {
49
57
  max-width: 100%;
@@ -87,6 +95,28 @@ html {
87
95
  }
88
96
  }
89
97
  }
98
+ }
99
+
100
+ // 4. Scoped Layout, Typography, and Component Styles
101
+ #{$scope-selector} {
102
+ color-scheme: var(--color-scheme);
103
+ font-family: Montserrat, Roboto, "Helvetica Neue", sans-serif;
104
+ font-size: 13px;
105
+ background-color: var(--page-background-color);
106
+ color: var(--text-color);
107
+
108
+ a {
109
+ color: var(--link-color);
110
+ text-decoration: none;
111
+ }
112
+
113
+ h3 {
114
+ font-weight: 700;
115
+ }
116
+
117
+ .mat-mdc-standard-chip .mdc-evolution-chip__text-label {
118
+ font-size: 12px;
119
+ }
90
120
 
91
121
  .mat-mdc-tab-group {
92
122
  .mat-mdc-tab-header {
@@ -146,7 +176,8 @@ html {
146
176
  }
147
177
  }
148
178
 
149
- &[data-theme="dark"] {
179
+ &[data-theme="dark"],
180
+ [data-theme="dark"] & {
150
181
  code.highlight {
151
182
  &.copyable-like {
152
183
  background-color: var(--copyable-background-color-darker);
@@ -206,24 +237,39 @@ html {
206
237
  background-color: var(--error-text-color);
207
238
  }
208
239
  }
209
- }
210
240
 
211
- /* clears the 'X' from Internet Explorer */
212
- input.hide-clear[type="search"]::-ms-clear,
213
- input.hide-clear[type="search"]::-ms-reveal {
214
- display: none;
215
- width: 0;
216
- height: 0;
217
- }
241
+ /* Browser-specific helper cleanup within scope */
242
+ #{$scope-selector} {
243
+ input.hide-clear[type="search"]::-ms-clear,
244
+ input.hide-clear[type="search"]::-ms-reveal {
245
+ display: none;
246
+ width: 0;
247
+ height: 0;
248
+ }
218
249
 
219
- /* clears the 'X' from Chrome */
220
- input.hide-clear[type="search"]::-webkit-search-decoration,
221
- input.hide-clear[type="search"]::-webkit-search-cancel-button,
222
- input.hide-clear[type="search"]::-webkit-search-results-button,
223
- input.hide-clear[type="search"]::-webkit-search-results-decoration {
224
- display: none;
250
+ input.hide-clear[type="search"]::-webkit-search-decoration,
251
+ input.hide-clear[type="search"]::-webkit-search-cancel-button,
252
+ input.hide-clear[type="search"]::-webkit-search-results-button,
253
+ input.hide-clear[type="search"]::-webkit-search-results-decoration {
254
+ display: none;
255
+ }
256
+
257
+ .add-btn span[matchipaction][aria-disabled="false"] {
258
+ cursor: pointer;
259
+ }
260
+ }
225
261
  }
226
262
 
227
- .add-btn span[matchipaction][aria-disabled="false"] {
228
- cursor: pointer;
263
+ // Fallback for apps that have not opted in to scoped styles ($global-styles is true by default)
264
+ @if $global-styles {
265
+ html {
266
+ overflow: -moz-scrollbars-vertical;
267
+ overflow-y: scroll;
268
+ }
269
+
270
+ html > body {
271
+ margin: 0;
272
+ }
273
+
274
+ @include apply-ng-configcat-publicapi-ui-styles("html > body");
229
275
  }