Skip to content

Commit ea5fec8

Browse files
committed
Self-review - clean up card, and radio-list styles; Clean up dropdown button
1 parent 2a3bae6 commit ea5fec8

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/assets/scss/6-components/molecules/_card.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
box-shadow: 0px 3px 10px rgba(0, 26, 57, 0.2);
44

55
&__content {
6+
@include padding(16px);
67
background-color: #425163;
78
height: 147px;
89
border-radius: 5px 5px 0 0;
9-
@include padding(16px);
1010
position: relative;
1111

1212
p {

src/assets/scss/6-components/molecules/_radio-list.scss

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,8 @@
4444
border-radius: $border-radius-large;
4545
border: 1px solid get-color-neutral("30");
4646

47-
// Styles for native implmentation of :focus-within.
48-
&:focus-within {
49-
@include c-radio-focus-hover;
50-
}
51-
52-
// Styles for polyfill implementation to support IE. When grouping selectors
53-
// together, IE doesn't display desired styles.
54-
&.focus-within {
55-
@include c-radio-focus-hover;
56-
}
57-
47+
&:focus-within, // Styles for native implmentation of :focus-within.
48+
&.focus-within, // Styles for polyfill implementation to support IE. When grouping selectors together, IE doesn't display desired styles.
5849
&:hover {
5950
@include c-radio-focus-hover;
6051
}

src/molecules/dropdown-button/dropdown-button.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ import uuid from "uuid";
44
import { ButtonSizes } from "../../atoms/constants/button-sizes";
55
import { ButtonStyles } from "../../atoms/constants/button-styles";
66

7+
// -------------------------------------------------------------------------------------------------
8+
// #region Constants
9+
// -------------------------------------------------------------------------------------------------
10+
11+
const COMPONENT_CLASS = "c-dropdown-button";
12+
const COMPONENT_LIST_CLASS = `${COMPONENT_CLASS}__list`;
13+
14+
// #endregion Constants
15+
716
// -------------------------------------------------------------------------------------------------
817
// #region Interfaces
918
// -------------------------------------------------------------------------------------------------
@@ -32,7 +41,7 @@ const DropdownButton: React.FC<DropdownButtonProps> = (
3241
) => {
3342
const { buttonClassName, menuItems, buttonContents, size, style } = props;
3443

35-
const classNames = ["c-button", "c-dropdown-button"];
44+
const classNames = ["c-button", COMPONENT_CLASS];
3645

3746
if (buttonClassName != null) {
3847
classNames.push(buttonClassName);
@@ -51,12 +60,12 @@ const DropdownButton: React.FC<DropdownButtonProps> = (
5160
<MenuButton className={classNames.join(" ")}>
5261
{buttonContents}
5362
</MenuButton>
54-
<MenuList className="c-dropdown-button__list">
63+
<MenuList className={COMPONENT_LIST_CLASS}>
5564
{menuItems.map((item: DropdownItem) => (
5665
<MenuItem
5766
key={uuid.v4()}
5867
onSelect={item.onSelect}
59-
className={"c-dropdown-button__list__item"}>
68+
className={`${COMPONENT_LIST_CLASS}__item`}>
6069
{item.component}
6170
</MenuItem>
6271
))}

0 commit comments

Comments
 (0)