@yomotech/view-toolkit 1.0.84 → 1.0.85

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.
@@ -3383,11 +3383,19 @@ function themeDeviceCss(id, own) {
3383
3383
  * the app sets (themePartCss): without one there is no rule and today's look stays; a page's own style (stylePerCard,
3384
3384
  * inline) still wins over it, as the order theme -> app -> page -> element says (point 173 step 4b).
3385
3385
  */
3386
+ /** A font role's parts as CSS properties. */
3387
+ const ROLE_PROPERTIES = [['family', 'font-family'], ['size', 'font-size'], ['weight', 'font-weight'],
3388
+ ['line-height', 'line-height'], ['letter-spacing', 'letter-spacing'], ['case', 'text-transform'], ['style', 'font-style'],
3389
+ ['decoration', 'text-decoration'], ['shadow', 'text-shadow']];
3390
+ const roleParts = (role, selector) => ROLE_PROPERTIES.map(([part, property]) => ({ key: `text.${role}.${part}`, selector, declaration: `${property}: $` }));
3386
3391
  const DESIGN_PARTS = [
3387
3392
  { key: 'space.card', selector: '.vl-card-body', declaration: 'padding: $' },
3388
3393
  { key: 'shape.card-radius', selector: '.vl-card-body', declaration: 'border-radius: $' },
3389
3394
  { key: 'border.card-width', selector: '.vl-card-body', declaration: 'border: $ solid var(--vl-color-border, #e5e7eb)' },
3390
3395
  { key: 'shadow.card', selector: '.vl-card-body', declaration: 'box-shadow: $' },
3396
+ // the font roles label and value on a card's fields (vl-control display: vl-control__label, vl-control__value)
3397
+ ...roleParts('label', '.vl-card-body .vl-control__label'),
3398
+ ...roleParts('value', '.vl-card-body .vl-control__value'),
3391
3399
  ];
3392
3400
  /** The rules of DESIGN_PARTS for the values the theme and the app's own values set (also through "from"); '' when none. */
3393
3401
  function themePartCss(id, own) {
@@ -3395,7 +3403,8 @@ function themePartCss(id, own) {
3395
3403
  return DESIGN_PARTS
3396
3404
  .map((part) => ({ part, item: designValue(part.key) }))
3397
3405
  .filter(({ item }) => item && variables[item.cssVar] !== undefined)
3398
- .map(({ part, item }) => `${part.selector} { ${part.declaration.replace('$', `var(${item.cssVar})`)}; }`)
3406
+ // in :where() - no weight: an app's own class or rule always wins over the theme
3407
+ .map(({ part, item }) => `:where(${part.selector}) { ${part.declaration.replace('$', `var(${item.cssVar})`)}; }`)
3399
3408
  .join('\n');
3400
3409
  }
3401
3410