152152 visibility : var (--_ui5_switch_text_hidden );
153153}
154154
155- .ui5-switch-root .ui5-switch--checked .ui5-switch--semantic .ui5-switch-text--on ,
155+ .ui5-switch-root .ui5-switch--checked .ui5-switch--semantic .ui5-switch-text--on ,
156156.ui5-switch-root .ui5-switch--checked .ui5-switch--desktop .ui5-switch--no-label .ui5-switch-text--on {
157157 inset-inline-start : var (--_ui5_switch_text_active_left );
158158}
362362
363363: dir (rtl ).ui5-switch-root .ui5-switch--checked .ui5-switch-slider {
364364 transform : var (--_ui5_switch_rtl_transform );
365- }
365+ }
366+
367+ /* Readonly switch styling */
368+ : host ([readonly ]) .ui5-switch-root {
369+ cursor : default;
370+ }
371+
372+ : host ([readonly ]) .ui5-switch-track ,
373+ : host ([readonly ]) .ui5-switch-root .ui5-switch--semantic .ui5-switch-track {
374+ background : var (--sapField_ReadOnly_Background );
375+ border : 0.0625rem var (--_ui5_switch_readonly_track_border_style ) var (--sapField_ReadOnly_BorderColor );
376+ }
377+
378+ : host ([readonly ]) .ui5-switch-handle ,
379+ : host ([readonly ]) .ui5-switch-root .ui5-switch--semantic .ui5-switch-handle {
380+ background : var (--sapField_ReadOnly_Background );
381+ border : 0.0625rem var (--_ui5_switch_readonly_handle_border_style ) var (--sapField_ReadOnly_BorderColor );
382+ }
383+
384+ : host ([readonly ]) .ui5-switch-text--on ,
385+ : host ([readonly ]) .ui5-switch-text--off ,
386+ : host ([readonly ]) .ui5-switch-no-label-icon-on ,
387+ : host ([readonly ]) .ui5-switch-no-label-icon-off ,
388+ : host ([readonly ]) .ui5-switch-icon-on ,
389+ : host ([readonly ]) .ui5-switch-icon-off ,
390+ : host ([readonly ]) .ui5-switch-root .ui5-switch--semantic .ui5-switch-icon-on ,
391+ : host ([readonly ]) .ui5-switch-root .ui5-switch--semantic .ui5-switch-icon-off ,
392+ : host ([readonly ]) .ui5-switch-root .ui5-switch--semantic .ui5-switch-text--on ,
393+ : host ([readonly ]) .ui5-switch-root .ui5-switch--semantic .ui5-switch-text--off {
394+ color : var (--sapButton_Handle_TextColor );
395+ }
396+
397+ /* Readonly switch - remove hover effects */
398+ : host ([readonly ]) .ui5-switch--desktop .ui5-switch-root : hover .ui5-switch-handle ,
399+ : host ([readonly ]) .ui5-switch--desktop .ui5-switch-root .ui5-switch--checked : hover .ui5-switch-handle ,
400+ : host ([readonly ]) .ui5-switch--desktop .ui5-switch-root .ui5-switch--semantic : hover .ui5-switch-handle ,
401+ : host ([readonly ]) .ui5-switch--desktop .ui5-switch-root .ui5-switch--semantic .ui5-switch--checked : hover .ui5-switch-handle {
402+ box-shadow : none;
403+ }
404+
405+ : host ([readonly ]) .ui5-switch--desktop .ui5-switch-root : hover .ui5-switch-track ,
406+ : host ([readonly ]) .ui5-switch--desktop .ui5-switch-root : hover .ui5-switch-handle ,
407+ : host ([readonly ]) .ui5-switch--desktop .ui5-switch-root .ui5-switch--semantic : hover .ui5-switch-track ,
408+ : host ([readonly ]) .ui5-switch--desktop .ui5-switch-root .ui5-switch--semantic : hover .ui5-switch-handle {
409+ background : var (--sapField_ReadOnly_Background );
410+ border-color : var (--sapField_ReadOnly_BorderColor );
411+ }
0 commit comments