@rdlabo/ionic-theme-ios27 1.0.1 → 1.0.2

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.
@@ -92,6 +92,15 @@ This is an introductory group. Place regular list items in a separate `ion-item-
92
92
 
93
93
  ## Full-width segments
94
94
 
95
+ Add `.segment-style-glass` to give a segment the same glass surface and selected indicator treatment as the tab bar. The class preserves the segment's existing dimensions and text colors, supports scrollable segments, and respects Ionic's public `--background` property.
96
+
97
+ ```html
98
+ <ion-segment class="segment-style-glass" value="available">
99
+ <ion-segment-button value="available">Available</ion-segment-button>
100
+ <ion-segment-button value="away">Away</ion-segment-button>
101
+ </ion-segment>
102
+ ```
103
+
95
104
  For colored segments, use Ionic's `color` property (for example, `color="primary"` or `color="secondary"`). The selected surface uses the palette's base color and the selected label uses its contrast color. The optional moving glass inherits the same surface color; custom Ionic palettes work without additional registration.
96
105
 
97
106
  Add `.segment-expand` when segment buttons should divide the available width evenly. The class also changes the Liquid Glass effect sizing when `registerSegmentEffect` is used.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { copyFile } from 'node:fs/promises';
4
- import { resolve } from 'node:path';
3
+ import { copyFile, mkdir } from 'node:fs/promises';
4
+ import { dirname, resolve } from 'node:path';
5
5
  import process from 'node:process';
6
6
  import { URL } from 'node:url';
7
7
 
@@ -11,4 +11,7 @@ if (!destination) {
11
11
  throw new Error('Usage: rdlabo-copy-structured-list <destination>');
12
12
  }
13
13
 
14
- await copyFile(new URL('../src/styles/structured-list.scss', import.meta.url), resolve(destination));
14
+ const destinationPath = resolve(destination);
15
+
16
+ await mkdir(dirname(destinationPath), { recursive: true });
17
+ await copyFile(new URL('../src/styles/structured-list.scss', import.meta.url), destinationPath);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rdlabo/ionic-theme-ios27",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "description": "iOS27 Theme for Ionic Framework",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "homepage": "https://docs.rdlabo.dev/projects/ionic-theme-ios27",
58
58
  "dependencies": {
59
- "@rdlabo/ionic-theme-utils": "git+https://github.com/rdlabo-dev/ionic-theme-utils.git#a3cbfd0c905c603bd90fb7c71b0b76031e8da7b9"
59
+ "@rdlabo/ionic-theme-utils": "git+https://github.com/rdlabo-dev/ionic-theme-utils.git#e82be4389d9209750229f5fee990046b5b1217da"
60
60
  },
61
61
  "bundleDependencies": [
62
62
  "@rdlabo/ionic-theme-utils"
@@ -1,4 +1,5 @@
1
1
  @use '../utils/api';
2
+ @use '../utils/glass';
2
3
 
3
4
  ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled) {
4
5
  --border-radius: 16px;
@@ -12,6 +13,24 @@ ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled) {
12
13
  }
13
14
  border-radius: var(--border-radius);
14
15
 
16
+ // Use the tab bar material without changing the segment's layout or size.
17
+ &.segment-style-glass {
18
+ --background: rgba(var(--ios-theme-glass-background-rgb, var(--ios26-glass-background-rgb)), 0.53);
19
+ box-sizing: border-box;
20
+ position: relative;
21
+ z-index: 0;
22
+ background: var(--background);
23
+ backdrop-filter: blur(6px) saturate(180%) brightness(1.05);
24
+ @include glass.light-rim;
25
+
26
+ ion-segment-button {
27
+ --indicator-color: rgba(
28
+ var(--ios-theme-button-color-selected-rgb, var(--ios26-button-color-selected-rgb, var(--ios27-button-color-selected-default-rgb))),
29
+ 0.095
30
+ );
31
+ }
32
+ }
33
+
15
34
  // UIKit uses a larger control in navigation bars, but not in content.
16
35
  &.in-toolbar:not(.segment-expand) {
17
36
  --border-radius: 24px;
@@ -55,6 +55,17 @@ ion-toolbar.ios:not(.ios-theme-disabled, .ios26-disabled).toolbar-searchbar {
55
55
  *[slot='end'] {
56
56
  align-self: center;
57
57
  }
58
+ ion-searchbar.ios:not(.ios-theme-disabled, .ios26-disabled) {
59
+ .searchbar-input-container {
60
+ margin-block: 0;
61
+ margin-inline: 4px;
62
+ }
63
+ &:is(.searchbar-should-show-cancel, :has(.searchbar-cancel-button:active):not(.searchbar-disabled)) {
64
+ .searchbar-input-container {
65
+ margin-inline-end: 11px;
66
+ }
67
+ }
68
+ }
58
69
  &:has(ion-buttons[slot='start']) {
59
70
  ion-buttons[slot='start'] {
60
71
  margin-inline-end: 6px;
@@ -1,4 +1,5 @@
1
1
  @use '../api';
2
+ @use '../glass';
2
3
 
3
4
  @mixin ion-segment {
4
5
  ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled) {
@@ -8,6 +9,25 @@
8
9
  .ios27-segment-edge {
9
10
  @include api.glass-lens-dark;
10
11
  }
12
+ &.segment-style-glass {
13
+ --background: color-mix(
14
+ in srgb,
15
+ color-mix(
16
+ in srgb,
17
+ rgb(var(--ios-theme-glass-background-rgb, var(--ios26-glass-background-rgb))) 92%,
18
+ rgb(var(--ion-text-color-rgb, 255, 255, 255))
19
+ )
20
+ 40%,
21
+ transparent
22
+ );
23
+ background: var(--background);
24
+ backdrop-filter: blur(6px) saturate(150%) brightness(1.23);
25
+ @include glass.dark-rim;
26
+
27
+ ion-segment-button {
28
+ --indicator-color: rgba(var(--ios-theme-button-color-selected-rgb, var(--ios26-button-color-selected-rgb, 0, 0, 0)), 0.72);
29
+ }
30
+ }
11
31
  }
12
32
  :where(ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled)) {
13
33
  --background: rgba(var(--ion-color-medium-rgb, 152, 154, 162), 0.19);