@@ -95,10 +112,6 @@ exports[`PageHeader renders default layout 1`] = `
}
.c1 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
@@ -146,6 +159,27 @@ exports[`PageHeader renders default layout 1`] = `
display: block;
}
+@media screen and (max-width:768px) {
+ .c1 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ }
+}
+
+@media screen and (min-width:768px) {
+ .c1 {
+ display: none;
+ }
+}
+
+@media screen and (min-width:1440px) {
+ .c1 {
+ display: none;
+ }
+}
+
(
+ // what is your value that you want to render responsivley? - responsiveValue
+ value: T,
+ fallback: F,
+ cssProperty: string,
+ truety: B,
+ falsy: C,
+): BetterSystemStyleObject {
+ if (isResponsiveValue(value)) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const responsiveValue = value as Extract>
+ const checkFallback = fallback ? truety : falsy
+
+ // arguments
+ // what is the value that we want to render responsively? - responsiveValue
+ // what is your css property? - display
+ // truety value - none
+ // falsy value - flex
+
+ return {
+ [`@media screen and (max-width: 768px)`]: {
+ [cssProperty]: 'narrow' in responsiveValue ? (responsiveValue.narrow ? truety : falsy) : checkFallback,
+ },
+ [`@media screen and (min-width: 768px)`]: {
+ [cssProperty]: 'regular' in responsiveValue ? (responsiveValue.regular ? truety : falsy) : checkFallback,
+ },
+ [`@media screen and (min-width: 1440px)`]: {
+ [cssProperty]: 'wide' in responsiveValue ? (responsiveValue.wide ? truety : falsy) : checkFallback,
+ },
+ }
+ } else {
+ return {[cssProperty]: value ? truety : falsy}
+ }
+}