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