Skip to content

Commit 0d7c9ec

Browse files
committed
Merge branch 'main-1.x' into refactor/remove-unused-tokens
2 parents ef3c888 + 059121e commit 0d7c9ec

File tree

10 files changed

+290
-66
lines changed

10 files changed

+290
-66
lines changed

component-design-tokens.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,30 @@
13161316
"requiredBy": [],
13171317
"icon": "stacked_bar_chart"
13181318
},
1319+
"scope": {
1320+
"$schema": "../../component-schema.json",
1321+
"apiVersion": 1,
1322+
"name": "Scope",
1323+
"slug": "scope",
1324+
"tokens": [
1325+
"base"
1326+
],
1327+
"description": "The Scope component groups inner content styles and limits the scope of styles to prevent them from affecting other parts of the interface.",
1328+
"tags": [
1329+
"scope",
1330+
"limit",
1331+
"reduce",
1332+
"wrap",
1333+
"wrapper"
1334+
],
1335+
"similarComponents": [
1336+
"container",
1337+
"section"
1338+
],
1339+
"requires": [],
1340+
"requiredBy": [],
1341+
"icon": "arrow_and_edge"
1342+
},
13191343
"segment": {
13201344
"$schema": "../../component-schema.json",
13211345
"apiVersion": 1,

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@helsingborg-stad/styleguide",
33
"appname": "styleguide",
4-
"version": "2.202.4",
4+
"version": "2.202.8",
55
"description": "",
66
"scripts": {
77
"test": "jest --coverage --maxWorkers=$(node -e \"console.log(Math.max(1, Math.floor(require('os').cpus().length / 2)))\")",

source/components/paper/style.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ $_: "c-paper";
88
("border-color": tokens.get($_, "color--surface-border"),
99
"border": tokens.use($_, "border-width", 1) solid tokens.get($_, "border-color"),
1010
"padding": 0,
11-
"shadow": tokens.use($_, "shadow", 1),
1211
"background-color": tokens.get($_, "color--surface"),
1312
"color": tokens.get($_, "color--surface-contrast"),
1413
),
@@ -24,7 +23,7 @@ $_: "c-paper";
2423
border-radius: tokens.use($_, "border-radius");
2524
corner-shape: tokens.get($_, "corner-shape");
2625
padding: tokens.get($_, "padding");
27-
filter: tokens.get($_, "shadow");
26+
filter: tokens.use($_, "shadow", 1);
2827

2928
> :first-child {
3029
--inherit-margin-top: 0;

source/components/scope/examples/basic.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@scope(['name' => 'a-unique-scope-id'])
1+
@scope(['name' => 'a-unique-scope-id', 'classList' => ['u-margin__bottom--2']])
22
@button([
33
'text' => 'Scope 1 - Button 1',
44
'color' => 'primary',
@@ -18,7 +18,7 @@
1818
@endbutton
1919
@endscope
2020

21-
@scope(['name' => 'a-unique-scope-id-2'])
21+
@scope(['name' => 'a-unique-scope-id-2', 'classList' => ['u-margin__bottom--2']])
2222
@button([
2323
'text' => 'Scope 2 - Button 1',
2424
'color' => 'primary',

source/design-builder/README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ Component mode starts when:
6565
2. window.styleguideCustomizeData exists, and
6666
3. window.styleguideDesignTokenLibrary exists and is valid
6767

68+
Init mode is controlled by:
69+
- window.styleguideCustomizeInitMode = "onload" | "manual"
70+
71+
Behavior:
72+
- onload: component customizer initializes automatically
73+
- manual: waits for click on [data-customize-init-fab]
74+
75+
Styleguide default:
76+
- manual mode via views/layout/master.blade.php
77+
78+
Theme / WP customizer usage:
79+
- set window.styleguideCustomizeInitMode = "onload" before loading design-builder script
80+
6881
Payloads are injected in:
6982
- views/layout/master.blade.php
7083

@@ -76,6 +89,11 @@ Payloads are produced by:
7689
Targets are discovered by:
7790
- [data-component]
7891

92+
Targets are skipped when they are inside:
93+
- [data-customizable="false"]
94+
95+
This excludes the marked component and all nested [data-component] descendants.
96+
7997
Examples:
8098
- data-component="button"
8199
- data-component="typography"
@@ -302,13 +320,13 @@ If selection still feels wrong, verify nested markup and where data-component is
302320

303321
## Current limitations
304322

305-
- Scope picker UI is not present; scope is inferred from selected target.
306-
- Component dropdown is component-first, scope retained from active target when possible.
323+
- Scope selector has a single General (all scopes) option plus detected named scopes per component context.
324+
- Component dropdown is component-first, with scope options based on where that component exists on the page.
307325
- Component-level mode focuses on direct editable targets marked with data-component.
326+
- Wrapper components used for scoping (scope/divider alias) are excluded from component customization.
308327

309328
## Suggested future improvements
310329

311-
- Add explicit scope selector in panel
312330
- Add breadcrumb for selected target path (component + scope)
313331
- Add per-scope export/import
314332
- Add optional keyboard navigation for target picking

source/design-builder/design-builder.scss

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -713,27 +713,8 @@
713713
pointer-events: none;
714714
}
715715

716-
.db-component-tool__toggle {
717-
pointer-events: auto;
718-
margin-left: auto;
719-
display: inline-flex;
720-
align-items: center;
721-
gap: 0.25rem;
722-
padding: 0.45rem 0.8rem;
723-
font-size: 0.8125rem;
724-
font-family: inherit;
725-
line-height: 1.4;
726-
color: var(--color--surface-contrast, #2d2d2d);
727-
background: var(--color--surface, #fff);
728-
border: 1px solid var(--color--surface-border, #ccc);
729-
border-radius: 999px;
730-
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
731-
cursor: pointer;
732-
}
733-
734716
.db-component-tool__panel {
735717
pointer-events: auto;
736-
margin-top: 0.75rem;
737718
max-height: min(70vh, 760px);
738719
overflow: auto;
739720
border: 1px solid var(--color--surface-border, #ccc);
@@ -866,9 +847,9 @@
866847
transform: translateY(-3px);
867848
transition: opacity 0.15s ease, transform 0.15s ease;
868849
max-width: calc(100% - 1rem);
869-
white-space: nowrap;
870-
overflow: hidden;
871-
text-overflow: ellipsis;
850+
white-space: normal;
851+
overflow-wrap: anywhere;
852+
text-overflow: clip;
872853
}
873854

874855
&:hover::after {

0 commit comments

Comments
 (0)