Skip to content

Commit dc866ea

Browse files
committed
🐛 fix debugging/dump mixins
they errored when folks ran them
1 parent fcd70ce commit dc866ea

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ Workarounds:
4545
- Use a VPN or work from a different location (aka different IP address)
4646
- Comment out the line `RUN dart pub get` in the Dockerfile, build the image, and run `dart pub get` within the container to get the dependencies manually
4747

48+
# Troubleshooting styles
49+
50+
You can add the following mixing to the bottom of the `book.scss` file to print out additional debugging information:
51+
52+
```scss
53+
// This one is probably the most useful. It shows all the settings, what they are set to, and if they have been overridden
54+
@include debug_settings();
55+
56+
@include debug_settings_manifest();
57+
@include debug_shapes();
58+
@include debug_enums();
59+
```
60+
4861
# Important Links
4962
- [CE Team Confluence Documentation](https://openstax.atlassian.net/wiki/spaces/CE/overview)
5063
- [How to Release CE Styles](https://openstax.atlassian.net/l/c/TjrhH68R)

styles/framework/design-shape/_init.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ $FRAMEWORK_SPACE_PLACE: ();
6868
@include error(error_message($unwrapped_shape));
6969
} @else {
7070
$FRAMEWORK_SPACE_PLACE: map-merge(
71-
$FRAMEWORK_SPACE_PLACE,
71+
$FRAMEWORK_SPACE_PLACE,
7272
($name: map-merge(
7373
$unwrapped_shape,
7474
(_parent: enum('Object:::NONE'))
@@ -94,7 +94,7 @@ $FRAMEWORK_SPACE_PLACE: ();
9494
$unwrapped,
9595
(_components: $shape_components)
9696
);
97-
}
97+
}
9898
}
9999

100100
@function get_nested_components($components, $subselector_prefix: '') {
@@ -111,7 +111,7 @@ $FRAMEWORK_SPACE_PLACE: ();
111111
$component_name: map-deep-get($component, _name);
112112
$component_subselector: map-deep-get($component, _subselector);
113113
$component_properties: map-deep-get($component, _properties);
114-
114+
115115
@if is_error($component_name) {
116116
@return $component_name;
117117
}
@@ -127,7 +127,7 @@ $FRAMEWORK_SPACE_PLACE: ();
127127
}
128128

129129
$computed_subselector: #{$subselector_prefix}#{$component_subselector};
130-
130+
131131
$copied_component: map-merge($copied_component, (_name: $component_name));
132132
$copied_component: map-merge($copied_component, (_subselector: $computed_subselector));
133133
$copied_component: map-merge($copied_component, (_properties: $component_properties));
@@ -159,7 +159,7 @@ $FRAMEWORK_SPACE_PLACE: ();
159159
@return map-deep-get($FRAMEWORK_SPACE_PLACE, $name);
160160
}
161161

162-
///
162+
///
163163
/// @group publicapi
164164
@mixin create_subshape($name, $parent, $changes) {
165165
@if not shape-exists($parent) {
@@ -279,7 +279,7 @@ $FRAMEWORK_SPACE_PLACE: ();
279279
$context_selectors: settings("#{$name}:::_selectors");
280280
@if is_error($context_selectors) {
281281
@include error(error_message($context_selectors));
282-
} @else {
282+
} @else {
283283
@each $selector in settings("#{$name}:::_selectors") {
284284
$shape: get_root($subshape_name);
285285
@each $component in map-deep-get($shape, _components) {
@@ -315,7 +315,7 @@ $FRAMEWORK_SPACE_PLACE: ();
315315
}
316316
} @else {
317317
$old_value_set: map-deep-get($spent_keys, $key);
318-
@if $value_set != enum('ValueSet:::OPTIONAL') and
318+
@if $value_set != enum('ValueSet:::OPTIONAL') and
319319
($value_set != enum('ValueSet:::REQUIRED') or $old_value_set == enum('ValueSet:::OPTIONAL')) {
320320
@include error("Shape `#{$ancestor_name}` is not a proper shape due to `#{$key}`.");
321321
}
@@ -327,4 +327,4 @@ $FRAMEWORK_SPACE_PLACE: ();
327327
}
328328
}
329329
}
330-
}
330+
}

styles/framework/settings/_init.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use "sass:meta";
12
$FRAMEWORK_SETTINGS_MANIFEST_GLOBAL: ();
23
$FRAMEWORK_USED_SETTINGS: ();
34

@@ -21,9 +22,9 @@ $FRAMEWORK_USED_SETTINGS: ();
2122
@debug "=== Clump Start ===";
2223
@each $key, $value in flatten_keep_references($settings) {
2324
@if map-get($already_defined, $key) {
24-
@debug "~~#{$key} : #{$value}~~ (overridden above)";
25+
@debug "~~#{$key} : #{meta.inspect($value)}~~ (overridden above)";
2526
} @else {
26-
@debug "#{$key} : #{$value}";
27+
@debug "#{$key} : #{meta.inspect($value)}";
2728
}
2829
$already_defined: map-merge($already_defined, ($key: true));
2930
}

0 commit comments

Comments
 (0)