Skip to content

Commit 9e8db6a

Browse files
chore: add root part
1 parent bae9ae4 commit 9e8db6a

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

packages/main/src/RadioButton.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ let activeRadio: RadioButton;
6868
* @public
6969
* @csspart outer-ring - Used to style the outer ring of the `ui5-radio-button`.
7070
* @csspart inner-ring - Used to style the inner ring of the `ui5-radio-button`.
71+
* @csspart root - Used to style the root DOM element of the component.
7172
*/
7273
@customElement({
7374
tag: "ui5-radio-button",

packages/main/src/RadioButtonTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default function RadioButtonTemplate(this: RadioButton) {
77
<div
88
role="radio"
99
class="ui5-radio-root"
10+
part="root"
1011
aria-checked={this.checked}
1112
aria-disabled={this.effectiveAriaDisabled}
1213
aria-describedby={this.effectiveAriaDescribedBy}

packages/main/test/pages/RadioButton.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link rel="stylesheet" type="text/css" href="./styles/RadioButton.css">
99
</head>
1010

11-
<body class="radiobutton1auto sapUiSizeCompact">
11+
<body class="radiobutton1auto">
1212

1313
<ui5-radio-button name="simple" text="Option A"></ui5-radio-button>
1414
<ui5-radio-button checked name="simple" text="Option B"></ui5-radio-button>
@@ -18,10 +18,7 @@
1818
<div aria-labelledby="radioGroupTitle1" role="radiogroup" class="radio-section">
1919
<ui5-title id="radioGroupTitle1">Group1 - None pre-selection</ui5-title>
2020
<ui5-radio-button id="testRbtn" text="N/A" disabled name="test"></ui5-radio-button>
21-
<ui5-radio-button
22-
id="testRbtn1"
23-
text="Male"
24-
name="test"></ui5-radio-button>
21+
<ui5-radio-button id="testRbtn1" text="Male" name="test"></ui5-radio-button>
2522
<ui5-radio-button id="testRbtn2" text="Female" name="test"></ui5-radio-button>
2623
</div>
2724

@@ -177,6 +174,15 @@
177174
<ui5-radio-button value-state="Positive" text="Outer ring with Positive State"></ui5-radio-button>
178175
</div>
179176

177+
<ui5-title level="H2">Custom font and focus outline</ui5-title>
178+
<div>
179+
<ui5-radio-button class="customizedRB" text="Item 1"></ui5-radio-button>
180+
<br>
181+
<ui5-radio-button class="customizedRB" text="Item 2"></ui5-radio-button>
182+
<br>
183+
<ui5-radio-button class="customizedRB" text="Item 3"></ui5-radio-button>
184+
</div>
185+
180186
<script>
181187
var counter = 0;
182188
var groupEventCounter = 0;

packages/main/test/pages/styles/RadioButton.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,14 @@ div.customStyling{
3636
}
3737
.customStyling ui5-radio-button[value-state="Positive"]::part(outer-ring) {
3838
stroke: rgb(12 223 147);
39+
}
40+
41+
.customizedRB::part(root):focus::before,
42+
.customizedRB::part(root):focus-visible::before {
43+
inset: -2px;
44+
}
45+
46+
.customizedRB {
47+
padding: 3px;
48+
font-size: 30px
3949
}

0 commit comments

Comments
 (0)