Skip to content

Checkbox, Radio and Select styles added #705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Radio component styling added
  • Loading branch information
imtananikhwa committed Feb 23, 2024
commit 8c7c873745716cd1153bed49e733778e0e2d161c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const getStyle = (style: CheckboxStyleType) => {
.ant-checkbox-inner {
background-color: ${style.checkedBackground};
border-color: ${style.checkedBackground};
border-width:${!!style.borderWidth ? style.borderWidth : '2px'};

&::after {
border-color: ${style.checked};
Expand All @@ -46,6 +47,7 @@ export const getStyle = (style: CheckboxStyleType) => {

&::after {
border-color: ${style.checkedBackground};
border-width:${!!style.borderWidth ? style.borderWidth : '2px'};
border-radius: ${style.radius};
}
}
Expand All @@ -54,15 +56,23 @@ export const getStyle = (style: CheckboxStyleType) => {
border-radius: ${style.radius};
background-color: ${style.uncheckedBackground};
border-color: ${style.uncheckedBorder};
border-width:${!!style.borderWidth ? style.borderWidth : '2px'};
}

&:hover .ant-checkbox-inner,
.ant-checkbox:hover .ant-checkbox-inner,
.ant-checkbox-input:focus + .ant-checkbox-inner {
border-color: ${style.checkedBackground};
border-width:${!!style.borderWidth ? style.borderWidth : '2px'};
}
}

.ant-checkbox-group-item {
font-family:${style.fontFamily};
font-size:${style.textSize};
font-weight:${style.textWeight};
font-style:${style.fontStyle};
}
.ant-checkbox-wrapper {
padding: ${style.padding};
.ant-checkbox-inner,
Expand All @@ -73,7 +83,7 @@ export const getStyle = (style: CheckboxStyleType) => {
`;
};

const CheckboxGroup = styled(AntdCheckboxGroup)<{
const CheckboxGroup = styled(AntdCheckboxGroup) <{
$style: CheckboxStyleType;
$layout: ValueFromOption<typeof RadioLayoutOptions>;
}>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const getStyle = (style: RadioStyleType) => {
padding: ${style.padding};
span:not(.ant-radio) {
${EllipsisTextCss};
font-family:${style.fontFamily};
font-size:${style.textSize};
font-weight:${style.textWeight};
font-style:${style.fontStyle};
}

.ant-radio-checked {
Expand All @@ -37,7 +41,7 @@ const getStyle = (style: RadioStyleType) => {
.ant-radio-inner {
background-color: ${style.uncheckedBackground};
border-color: ${style.uncheckedBorder};

border-width:${style.borderWidth};
&::after {
background-color: ${style.checked};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,8 @@ function checkAndUncheck() {
}

export const CheckboxStyle = [
LABEL,
// LABEL,
...replaceAndMergeMultipleStyles(STYLING_FIELDS_SEQUENCE, 'text', [LABEL, STATIC_TEXT, VALIDATE]).filter((style) => style.name !== 'border'),
...checkAndUncheck(),
{
name: "checked",
Expand All @@ -850,15 +851,16 @@ export const CheckboxStyle = [
depType: DEP_TYPE.CONTRAST_TEXT,
transformer: contrastText,
},
RADIUS,
STATIC_TEXT,
VALIDATE,
MARGIN,
PADDING,
// RADIUS,
// STATIC_TEXT,
// VALIDATE,
// MARGIN,
// PADDING,
] as const;

export const RadioStyle = [
LABEL,
// LABEL,
...replaceAndMergeMultipleStyles(STYLING_FIELDS_SEQUENCE, 'text', [LABEL, STATIC_TEXT, VALIDATE]).filter((style) => style.name !== 'border' && style.name !== 'radius'),
...checkAndUncheck(),
{
name: "checked",
Expand All @@ -867,10 +869,10 @@ export const RadioStyle = [
depType: DEP_TYPE.SELF,
transformer: toSelf,
},
STATIC_TEXT,
VALIDATE,
MARGIN,
PADDING,
// STATIC_TEXT,
// VALIDATE,
// MARGIN,
// PADDING,
] as const;

export const SegmentStyle = [
Expand Down Expand Up @@ -1019,7 +1021,7 @@ export const TableColumnLinkStyle = [
export const FileStyle = [
// ...getStaticBgBorderRadiusByBg(SURFACE_COLOR),
getStaticBackground(SURFACE_COLOR),
...replaceAndMergeMultipleStyles(STYLING_FIELDS_SEQUENCE,'border',[getStaticBorder('#00000000')]),
...replaceAndMergeMultipleStyles(STYLING_FIELDS_SEQUENCE, 'border', [getStaticBorder('#00000000')]),
// TEXT, ACCENT, MARGIN, PADDING
] as const;

Expand Down