@visns-studio/visns-components 6.1.4 → 6.1.6

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,47 @@
1
1
  @use 'controls' as *;
2
2
 
3
+ /* ============================================================================
4
+ Page header density hooks
5
+ ----------------------------------------------------------------------------
6
+ One header bar, one spec, shared by every page that draws a page title —
7
+ the index (`.crmtitle` here) and the detail/breadcrumb header
8
+ (`.crmtitle` in GenericDetail.module.scss). Both files carry the same
9
+ declarations so the two pages sit on the same baseline: a white surface
10
+ flush under the nav, one bottom hairline, the same padding, and the same
11
+ title type scale. Change one, change the other.
12
+
13
+ As with the `--nav-*` set (see the block at the top of
14
+ Navigation.module.scss), every declaration below is written
15
+ `var(--hook, <the value it always had>)`, so an unset hook is a no-op and a
16
+ project retunes density from `:root` in its own stylesheet — no fork, no
17
+ prop, no class.
18
+
19
+ --page-header-padding the bar's own padding, and what aligns the title
20
+ with the nav's content. A project that has
21
+ retuned `--nav-bar-padding` will usually want to
22
+ set this to the same horizontal value.
23
+ default: var(--spacing-md, 1rem)
24
+ --page-header-title-size the page title type size. The breadcrumb's
25
+ parent crumb and the current entity are both set
26
+ from this, so the two pages share one scale.
27
+ default: 1.25rem
28
+ --page-header-gap space between the title block and the
29
+ right-aligned action/count slot.
30
+ default: var(--spacing-md, 1rem)
31
+
32
+ Deliberately not hooks: the surface colour and the hairline. Those are the
33
+ existing `--item-color` / `--border-color` tokens every project already
34
+ sets, and a header that does not match the page's other surfaces is a bug
35
+ rather than a density preference.
36
+
37
+ Note the concrete fallbacks. `--spacing-*`, `--muted-color` and
38
+ `--surface-color` are not part of every consuming project's token set; a
39
+ bare `var(--spacing-md)` there is invalid at computed-value time and the
40
+ whole declaration is dropped (padding silently becomes 0). Every use of a
41
+ token outside the common set is written with a literal fallback for that
42
+ reason.
43
+ ========================================================================= */
44
+
3
45
  .btn {
4
46
  @include button-primary;
5
47
  }
@@ -721,51 +763,79 @@
721
763
  }
722
764
  }
723
765
 
724
- .crmtitle {
766
+ /* The unified page header bar — see the hooks block at the top of this file.
767
+ `.crmtitle` is applied to the same element as `.grid__full`, so it has to
768
+ undo that card's border, radius, shadow and 2px padding: a page header is
769
+ not a card sitting on the page, it is the top edge of the page.
770
+
771
+ `.crmtitleSimple` is the non-`full` layout's variant. It had no rule at all
772
+ in this file, so those pages fell through to the bare `.grid__full` card —
773
+ an unstyled title stacked above its actions. It joins the same bar. */
774
+ .crmtitle,
775
+ .crmtitleSimple {
725
776
  min-height: auto;
726
- /* Was a flat 1rem inside a tinted-navy border, which made the page title
727
- look like another card competing with the grid below it. A page header
728
- is not a card: no border, no fill, just the title and its count sitting
729
- on the page. */
730
- padding: 0 0 var(--spacing-md);
777
+ padding: var(--page-header-padding, var(--spacing-md, 1rem));
731
778
  margin: 0;
732
- background: none;
779
+ /* The surface every other panel already uses, so the bar reads as page
780
+ rather than as one more floating element. */
781
+ background: var(--item-color, #fff);
733
782
  border-radius: 0;
734
783
  border: none;
735
- border-bottom: 1px solid var(--border-color);
784
+ /* A single hairline is the whole separation — the shadow that `.grid__full`
785
+ carries would make this a card again. */
786
+ border-bottom: 1px solid var(--border-color, #e1e1e1);
787
+ box-shadow: none;
736
788
  position: relative;
737
789
  display: flex;
738
790
  align-items: center;
739
791
  justify-content: space-between;
792
+ gap: var(--page-header-gap, var(--spacing-md, 1rem));
740
793
 
741
794
  h1 {
742
795
  font-weight: 700;
743
- font-size: 1.25rem;
796
+ font-size: var(--page-header-title-size, 1.25rem);
744
797
  margin: 0;
745
798
  padding: 0;
746
- line-height: 1;
799
+ /* Was 1, which clipped descenders at this size. */
800
+ line-height: 1.25;
801
+ display: flex;
802
+ align-items: center;
803
+ min-width: 0;
804
+ }
747
805
 
748
- a {
749
- text-decoration: none;
750
- color: var(--secondary-color);
751
- font-weight: 400;
752
- }
806
+ /* A breadcrumb crumb: still a link, but it should not compete with the
807
+ page it leads to. Same size and baseline as the title, quieter weight
808
+ and colour. */
809
+ h1 a {
810
+ text-decoration: none;
811
+ color: var(--muted-color, rgba(var(--paragraph-color-rgb, 34, 30, 51), 0.6));
812
+ font-weight: 500;
813
+ transition: color 0.15s ease;
814
+ }
753
815
 
754
- svg {
755
- color: rgba(var(--primary-rgb), 0.5);
756
- position: relative;
757
- top: 2px;
758
- margin: 0 0.25rem;
759
- }
816
+ h1 a:hover {
817
+ color: var(--paragraph-color, inherit);
818
+ text-decoration: underline;
819
+ }
820
+
821
+ /* The chevron between crumbs — a separator, not a mark of its own. */
822
+ h1 svg {
823
+ color: var(--muted-color, rgba(var(--paragraph-color-rgb, 34, 30, 51), 0.45));
824
+ flex: 0 0 auto;
825
+ margin: 0 0.4rem;
760
826
  }
761
827
 
762
828
  .titleInfo {
829
+ /* The shared `.titleInfo` rule positions absolutely for other
830
+ surfaces; inside the bar it is a flex child like anything else. */
831
+ position: static;
763
832
  width: max-content;
833
+ flex: 0 0 auto;
764
834
  }
765
835
 
766
836
  .titleInfo span {
767
- font-size: 0.875em;
768
- color: rgba(var(--paragraph-color-rgb), 0.65);
837
+ font-size: 0.875rem;
838
+ color: var(--muted-color, rgba(var(--paragraph-color-rgb, 34, 30, 51), 0.65));
769
839
  }
770
840
  }
771
841