-
Notifications
You must be signed in to change notification settings - Fork 278
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
feat(date-picker): [date-picker] Adapting to the old-theme #2575
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,19 +260,19 @@ | |
border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
} | ||
&__row .in-range:first-of-type div { | ||
&__row td:first-of-type div { | ||
border-top-left-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
border-bottom-left-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
} | ||
&__row .in-range:last-of-type div { | ||
&__row td:last-of-type div { | ||
border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
} | ||
&__row td:nth-child(1 of .available.in-range) div { | ||
&__row td.pre-month + td.available.in-range div { | ||
border-top-left-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
border-bottom-left-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
} | ||
&__row td:nth-last-child(1 of .available.in-range) div { | ||
&__row td.available.in-range:has(+ td.next-month) div { | ||
border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled); | ||
Comment on lines
+263
to
277
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification The border radius variable usage is incorrect The code is using
The code should be modified to use the correct variables: &__row td:first-of-type div {
- border-top-left-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-left-radius: var(--tv-DateTable-td-border-radius-disabled);
+ border-top-left-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-left-radius: var(--tv-DateTable-td-border-radius);
}
&__row td:last-of-type div {
- border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled);
+ border-top-right-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-right-radius: var(--tv-DateTable-td-border-radius);
}
&__row td.pre-month + td.available.in-range div {
- border-top-left-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-left-radius: var(--tv-DateTable-td-border-radius-disabled);
+ border-top-left-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-left-radius: var(--tv-DateTable-td-border-radius);
}
&__row td.available.in-range:has(+ td.next-month) div {
- border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled);
+ border-top-right-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-right-radius: var(--tv-DateTable-td-border-radius);
} 🔗 Analysis chainReview the border radius variable usage and browser compatibility There are several concerns with the new selectors:
Consider applying this refactor for better maintainability and consistency: - &__row td:first-of-type div {
- border-top-left-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-left-radius: var(--tv-DateTable-td-border-radius-disabled);
- }
-
- &__row td:last-of-type div {
- border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled);
- }
-
- &__row td.pre-month + td.available.in-range div {
- border-top-left-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-left-radius: var(--tv-DateTable-td-border-radius-disabled);
- }
-
- &__row td.available.in-range:has(+ td.next-month) div {
- border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled);
- }
+ // Border radius for normal states
+ &__row {
+ td:first-of-type div {
+ border-top-left-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-left-radius: var(--tv-DateTable-td-border-radius);
+ }
+
+ td:last-of-type div {
+ border-top-right-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-right-radius: var(--tv-DateTable-td-border-radius);
+ }
+
+ // Range selection borders
+ td.pre-month + td.available.in-range div {
+ border-top-left-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-left-radius: var(--tv-DateTable-td-border-radius);
+ }
+
+ // Fallback for browsers that don't support :has
+ td.available.in-range.next-month-boundary div {
+ border-top-right-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-right-radius: var(--tv-DateTable-td-border-radius);
+ }
+
+ // Modern browsers
+ @supports selector(:has(*)) {
+ td.available.in-range:has(+ td.next-month) div {
+ border-top-right-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-right-radius: var(--tv-DateTable-td-border-radius);
+ }
+ }
+ } This refactor:
Let's verify the browser support for the 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check browser support for :has selector
curl -s "https://caniuse.com/api/features?feature=css-has" | jq '.data."css-has".support'
Length of output: 91 Script: #!/bin/bash
# Let's check if there are any existing CSS variables defined for border radius
rg "tv-DateTable-td-border-radius" -A 2 -B 2
# Also check for any other border radius variables that might be more appropriate
rg "border-radius.*var\(--" -A 2 -B 2
Length of output: 104115 |
||
} | ||
Comment on lines
+271
to
278
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Revise range border styling implementation The verification reveals that:
Recommended changes: &__row td.pre-month + td.available.in-range div {
- border-top-left-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-left-radius: var(--tv-DateTable-td-border-radius-disabled);
+ border-top-left-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-left-radius: var(--tv-DateTable-td-border-radius);
}
&__row td.available.in-range:has(+ td.next-month) div {
- border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled);
+ border-top-right-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-right-radius: var(--tv-DateTable-td-border-radius);
} 🔗 Analysis chainReview range border styling implementation The current implementation has several concerns:
Consider the following improvements: &__row td.pre-month + td.available.in-range div {
- border-top-left-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-left-radius: var(--tv-DateTable-td-border-radius-disabled);
+ border-top-left-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-left-radius: var(--tv-DateTable-td-border-radius);
}
- &__row td.available.in-range:has(+ td.next-month) div {
+ &__row td.available.in-range:last-child div,
+ &__row td.available.in-range + td.next-month div {
- border-top-right-radius: var(--tv-DateTable-td-border-radius-disabled);
- border-bottom-right-radius: var(--tv-DateTable-td-border-radius-disabled);
+ border-top-right-radius: var(--tv-DateTable-td-border-radius);
+ border-bottom-right-radius: var(--tv-DateTable-td-border-radius);
} Let's verify browser compatibility requirements: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check if there are any browser compatibility requirements in the project
rg -l "browserslist|@supports|\.browserlist" --type yaml --type json
Length of output: 116 Script: #!/bin/bash
# Check the browser compatibility configuration in package.json files
cat package.json packages/theme-saas/package.json | jq -r '.browserslist // empty'
# Check if :has() selector is already used elsewhere in the codebase
rg -l ":has\(" --type css --type less
# Check for existing border radius variables in theme files
rg "tv-DateTable-td-border-radius" --type css --type less
Length of output: 3768 |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Review border radius styling for first/last cells
The current implementation has several concerns:
--tv-DateTable-td-border-radius-disabled
for all cells might not be appropriate as it's meant for disabled statestd:first-of-type
andtd:last-of-type
will apply border radius to all cells, which might not be desired for middle cells in a range selectionConsider using a more specific approach:
📝 Committable suggestion