@rolemodel/optics 2.3.1 → 2.4.0

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.
@@ -2222,6 +2222,11 @@ small {
2222
2222
  flex-grow: 1;
2223
2223
  }
2224
2224
  /* Gap Properties */
2225
+ .gap-none {
2226
+ gap: 0;
2227
+
2228
+ --op-gap: 0;
2229
+ }
2225
2230
  .gap-xxs {
2226
2231
  gap: var(--op-space-2x-small);
2227
2232
 
@@ -2470,28 +2475,168 @@ small {
2470
2475
  .op-stack {
2471
2476
  display: flex;
2472
2477
  flex-direction: column;
2473
- }
2474
- :where(.op-stack) {
2475
- gap: var(--op-space-medium);
2478
+ margin-block: 0;
2479
+ margin-inline: 0;
2480
+
2481
+ /* zero specificity. Lets utilities override */
2482
+ :where(&) {
2483
+ gap: var(--op-space-medium);
2484
+ }
2476
2485
  }
2477
2486
  /* Equivalent to .flex.flex-wrap.items-center.gap-md */
2478
2487
  .op-cluster {
2479
2488
  display: flex;
2480
2489
  flex-wrap: wrap;
2481
- }
2482
- :where(.op-cluster) {
2483
- align-items: center;
2484
- gap: var(--op-space-medium);
2490
+ margin-block: 0;
2491
+ margin-inline: 0;
2492
+
2493
+ /* zero specificity. Lets utilities override */
2494
+ :where(&) {
2495
+ align-items: center;
2496
+ gap: var(--op-space-medium);
2497
+ }
2485
2498
  }
2486
2499
  /* Equivalent to .flex.flex-wrap.items-center.justify-between.gap-md */
2487
2500
  .op-split {
2488
2501
  display: flex;
2489
2502
  flex-wrap: wrap;
2490
2503
  justify-content: space-between;
2504
+ margin-block: 0;
2505
+ margin-inline: 0;
2506
+
2507
+ /* zero specificity. Lets utilities override */
2508
+ :where(&) {
2509
+ align-items: center;
2510
+ gap: var(--op-space-medium);
2511
+ }
2491
2512
  }
2492
- :where(.op-split) {
2493
- align-items: center;
2494
- gap: var(--op-space-medium);
2513
+ /*
2514
+ side by side layout with a small area and a large area
2515
+ similar to .flex with a .flex-grow-1 within it, but with a more semantic name and wrap handling.
2516
+
2517
+ |[] [ ]|
2518
+ |[ ] []| with end
2519
+ */
2520
+ .op-flank {
2521
+ display: flex;
2522
+ margin-block: 0;
2523
+ margin-inline: 0;
2524
+
2525
+ /* zero specificity. Lets utilities override */
2526
+ :where(&) {
2527
+ flex-wrap: wrap;
2528
+ align-items: center;
2529
+ gap: var(--op-space-medium);
2530
+ }
2531
+
2532
+ /* Small area */
2533
+ &:not(.op-flank--end) > :first-child,
2534
+ &.op-flank--end > :last-child {
2535
+ flex-basis: auto;
2536
+ flex-grow: 1;
2537
+ }
2538
+
2539
+ /* Large area */
2540
+ &:not(.op-flank--end) > :last-child,
2541
+ &.op-flank--end > :first-child {
2542
+ flex-basis: 0;
2543
+ flex-grow: 999;
2544
+ }
2545
+ }
2546
+ /* Grid Layout */
2547
+ .op-grid {
2548
+ --_op-grid-min-column-size: var(--op-space-4x-large);
2549
+ --_op-grid-max-column-size: 0px;
2550
+
2551
+ display: grid;
2552
+ grid-template-columns: repeat(
2553
+ auto-fit,
2554
+ minmax(max(var(--_op-grid-min-column-size), var(--_op-grid-max-column-size)), 1fr)
2555
+ );
2556
+ margin-block: 0;
2557
+ margin-inline: 0;
2558
+
2559
+ /* zero specificity. Lets utilities override */
2560
+ :where(&) {
2561
+ gap: var(--op-space-medium);
2562
+ }
2563
+
2564
+ &.op-grid--2-column {
2565
+ --_op-grid-max-column-size: calc(100% / 3);
2566
+ }
2567
+
2568
+ &.op-grid--3-column {
2569
+ --_op-grid-max-column-size: calc(100% / 4);
2570
+ }
2571
+
2572
+ &.op-grid--4-column {
2573
+ --_op-grid-max-column-size: calc(100% / 5);
2574
+ }
2575
+
2576
+ &.op-grid--5-column {
2577
+ --_op-grid-max-column-size: calc(100% / 6);
2578
+ }
2579
+
2580
+ &.op-grid--6-column {
2581
+ --_op-grid-max-column-size: calc(100% / 7);
2582
+ }
2583
+ }
2584
+ /* Frame */
2585
+ @property --_op-frame-inline-size {
2586
+ inherits: true;
2587
+ initial-value: 100%;
2588
+ syntax: '<length> | <percentage>';
2589
+ }
2590
+ .op-frame {
2591
+ display: flex;
2592
+ overflow: hidden;
2593
+ border-radius: inherit;
2594
+ aspect-ratio: 1 / 1;
2595
+ margin-block: 0;
2596
+ margin-inline: 0;
2597
+ max-inline-size: var(--_op-frame-inline-size);
2598
+
2599
+ :where(&) {
2600
+ align-items: center;
2601
+ justify-content: center;
2602
+ }
2603
+
2604
+ > img,
2605
+ > video {
2606
+ block-size: 100%;
2607
+ inline-size: 100%;
2608
+ object-fit: cover;
2609
+ }
2610
+
2611
+ /* aspect ratio */
2612
+
2613
+ &.op-frame--square {
2614
+ aspect-ratio: 1 / 1;
2615
+ }
2616
+
2617
+ &.op-frame--landscape {
2618
+ aspect-ratio: 16 / 9;
2619
+ }
2620
+
2621
+ &.op-frame--portrait {
2622
+ aspect-ratio: 9 / 16;
2623
+ }
2624
+
2625
+ &.op-frame--4-3 {
2626
+ aspect-ratio: 4 / 3;
2627
+ }
2628
+
2629
+ &.op-frame--3-4 {
2630
+ aspect-ratio: 3 / 4;
2631
+ }
2632
+
2633
+ &.op-frame--3-2 {
2634
+ aspect-ratio: 3 / 2;
2635
+ }
2636
+
2637
+ &.op-frame--2-3 {
2638
+ aspect-ratio: 2 / 3;
2639
+ }
2495
2640
  }
2496
2641
  /* Components */
2497
2642
  .accordion {
@@ -2539,7 +2684,7 @@ small {
2539
2684
  }
2540
2685
 
2541
2686
  &[open] {
2542
- summary .accordion__marker {
2687
+ > summary .accordion__marker {
2543
2688
  rotate: 0.25turn;
2544
2689
  }
2545
2690
 
@@ -5089,7 +5234,11 @@ dialog.modal {
5089
5234
 
5090
5235
  display: flex;
5091
5236
  flex-direction: column;
5092
- gap: var(--op-space-x-small);
5237
+
5238
+ /* zero specificity. Lets utilities override */
5239
+ :where(&) {
5240
+ gap: var(--op-space-x-small);
5241
+ }
5093
5242
 
5094
5243
  &.text-pair--inline {
5095
5244
  flex-direction: row;