Skip to content

Commit

Permalink
Refactor media query syntax in CSS files; remove 'screen' keyword for…
Browse files Browse the repository at this point in the history
… improved readability
  • Loading branch information
joao-vasconcelos committed Jan 9, 2025
1 parent f5cacdc commit f9df31d
Show file tree
Hide file tree
Showing 40 changed files with 160 additions and 108 deletions.
8 changes: 4 additions & 4 deletions frontend/components/alerts/AlertsListEmpty/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
.container {
display: flex;
flex-direction: column;
gap: var(--size-spacing-10);
align-items: center;
justify-content: center;
gap: var(--size-spacing-10);
padding: 0 var(--size-spacing-20) var(--size-spacing-40);
text-align: center;
font-weight: var(--font-weight-medium);
line-height: 1.3;
color: var(--color-system-text-300);
text-align: center;
}

/* * */
Expand All @@ -35,13 +35,13 @@
.actionWrapper {
display: flex;
flex-direction: row;
gap: var(--size-spacing-20);
align-items: center;
justify-content: center;
gap: var(--size-spacing-20);
margin-top: var(--size-spacing-20);
}

@media screen and (max-width: 600px) {
@media (width <= 600px) {
.actionWrapper {
flex-direction: column;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

.selectsWrapper {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr;
grid-template-columns: 1fr 1fr;
gap: var(--size-spacing-15);
justify-content: stretch;
width: 100%;
}


@media screen and (width <= 768px) {
@media (width <= 768px) {
.selectsWrapper {
grid-template-columns: 1fr;
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/cards/Discounts/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
padding: var(--size-spacing-30);
}

@media screen and (width < 1000px) {
@media (width < 1000px) {
.container {
grid-template-columns: 1fr;
}
Expand Down Expand Up @@ -60,14 +60,14 @@
text-align: center;
}

@media screen and (width < 1000px) {
@media (width < 1000px) {
.pricing {
padding-top: var(--size-spacing-30);
border-top: 1px dashed var(--color-system-border-100);
}
}

@media screen and (width <= 700px) {
@media (width <= 700px) {
.pricing {
flex-wrap: wrap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
border-radius: var(--border-radius-lg);
}

@media screen and (width <= 500px) {
@media (width <= 500px) {
.cardWrapper {
flex-direction: column;
}
Expand All @@ -33,8 +33,8 @@
}

.validity{
padding-top: var(--size-spacing-5);
font-size: 12px;
font-weight: var(--font-weight-medium);
color: var(--color-system-text-300);
padding-top: var(--size-spacing-5);
}
2 changes: 1 addition & 1 deletion frontend/components/cards/Pass/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
border-radius: var(--border-radius-lg);
}

@media screen and (width <= 500px) {
@media (width <= 500px) {
.cardWrapper {
grid-template-columns: 1fr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
padding: 0;
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.segmentedControlDateInputOverrideControl label {
padding-right: var(--size-spacing-15);
padding-left: var(--size-spacing-15);

}
}

@media screen and (width <= 350px) {
@media (width <= 350px) {
.segmentedControlDateInputOverrideControl label,
.segmentedControlDateInputOverrideControl:last-child label {
padding-top: var(--size-spacing-15);
Expand Down Expand Up @@ -58,7 +58,7 @@
color: var(--color-system-text-100);
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.datePickerInput {
padding-left: calc(var(--size-spacing-15) + 26px);
font-size: 14px;
Expand Down Expand Up @@ -87,7 +87,7 @@
color: var(--color-system-text-200);
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.datePickerSection svg {
width: 20px;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/header/Header/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
transform: translate(-20px, 0);
}

@media screen and (width <= 1200px) {
@media (width <= 1200px) {
.container.isSticky {
border-color: transparent;
border-bottom-color: var(--color-system-border-100);
border-radius: 0;
}
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.container,
.container.isSticky {
width: 100%;
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/helpdesks/Header/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
border-radius: var(--border-radius-lg);
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.cardWrapper {
grid-template-columns: 1fr;
gap: 0;
border: none;
border-radius: 0;
gap: 0;
}
}

Expand All @@ -28,7 +28,7 @@
padding: var(--size-spacing-15);
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.cardImage {
height: 100px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
.content {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 1rem;
grid-gap: var(--size-spacing-5);
}

.validity{
color: var(--color-system-text-300);
font-size: 10px;
font-style: semibold;
font-weight: 600;
font-style: SemiBold;
color: var(--color-system-text-300);
text-align: left;
}

.images {
display: flex;
gap: var(--size-spacing-5);
align-items: center;
justify-content: center;
gap: 1rem;
height: 100px;
width: 100px;
height: 100px;

& img {
height: 100%;
Expand All @@ -27,25 +27,25 @@

.cardAlt {
display: flex;
align-items: center;
flex-direction: row;
gap: 1rem;
gap: var(--size-spacing-5);
align-items: center;

& img {
height: 80px;
}
}

@media screen and (max-width: 768px) {
@media (width <= 768px) {
.content {
grid-template-columns: 1fr;
}

.card {
display: flex;
align-items: center;
flex-direction: row;
gap: 1rem;
gap: var(--size-spacing-5);)
align-items: center;

& img {
height: 80px;
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/helpdesks/WhereToBuy/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
}

a.cardWrapper:hover {
border-color: var(--color-system-border-200);
background-color: var(--color-system-background-200);
border-color: var(--color-system-border-200);
}

@media screen and (width <= 500px) {
@media (width <= 500px) {
.cardWrapper {
grid-template-columns: 1fr;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/home/SchedulesSection/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
grid-template-columns: repeat(4, 1fr);
}

@media screen and (width < 1000px) {
@media (width < 1000px) {
.gridNav {
grid-template-columns: 1fr 1fr;
}
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.gridNav {
grid-template-columns: 1fr;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/home/SupportSection/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
grid-template-columns: repeat(2, 1fr);
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.gridNav {
grid-template-columns: 1fr;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/home/TarifsSection/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
grid-template-columns: 1fr 1fr 1fr;
}

@media screen and (width < 1000px) {
@media (width < 1000px) {
.gridNav {
grid-template-columns: 1fr 1fr;
}
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.gridNav {
grid-template-columns: 1fr;
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/layout/Grid/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
grid-template-columns: 1fr 1fr 1fr 1fr;
}

@media screen and (width < 1000px) {
@media (width < 1000px) {
.container.aab {
grid-template-columns: 1fr 1fr;
}
Expand All @@ -89,7 +89,7 @@
}
}

@media screen and (width <= 900px) {
@media (width <= 900px) {
.container.aab {
grid-template-columns: 1fr;
}
Expand All @@ -107,7 +107,7 @@
}
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.container.abc {
grid-template-columns: 1fr;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/layout/GridNav/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

.container {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: 1fr;
grid-template-columns: repeat(4, 1fr);
gap: var(--size-spacing-20);
width: 100%;
padding: var(--size-spacing-20);
padding-top: 0;
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.container {
display: flex;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/layout/GridNavItem/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
border-color: var(--color-system-border-300);
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.container,
.container:hover,
.container:active {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
border-bottom: none;
}

@media screen and (width <= 650px) {
@media (width <= 650px) {
.container,
.container:hover,
.container:active {
Expand Down
18 changes: 16 additions & 2 deletions frontend/components/layout/Section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,26 @@ interface Props {
variant?: 'default' | 'muted' | 'standout' | 'success' | 'warning'
withBottomDivider?: boolean
withGap?: boolean
withPadding?: boolean
withPadding?: 'desktop' | 'mobile' | boolean
}

/* * */

export function Section({ children, heading, href, subheading, target, variant = 'default', withBottomDivider, withGap, withPadding }: Props) {
//

//
// A. Transform data

//
// B. Render components

return (
<section className={`${styles.container} ${withBottomDivider && styles.withBottomDivider} ${withGap && styles.withGap} ${withPadding && styles.withPadding} ${styles[variant]}`}>
<section
className={`${styles.container} ${withBottomDivider && styles.withBottomDivider} ${withGap && styles.withGap} ${styles[variant]}`}
data-with-padding-desktop={withPadding === 'desktop' || withPadding === true}
data-with-padding-mobile={withPadding === 'mobile' || withPadding === true}
>

{(heading || subheading) && (
<div className={styles.headingWrapper}>
Expand All @@ -46,4 +58,6 @@ export function Section({ children, heading, href, subheading, target, variant =

</section>
);

//
}
Loading

0 comments on commit f9df31d

Please sign in to comment.