Add a merged style to check types of react and native at the same time

This commit is contained in:
Zoe Roux
2022-11-17 01:16:53 +09:00
parent bf58c6f537
commit 186ccf783b
14 changed files with 94 additions and 100 deletions
+5 -9
View File
@@ -12,7 +12,7 @@ const CustomBox = ({ color, ...props }: { color: string } & Stylable) => {
const { css } = useYoshiki();
return (
<View {...css({ bg: color, p: "13px", alignItems: "center" }, props)}>
<View {...css({ bg: color, alignItems: "center" }, props)}>
<Text {...css({ color: "white" })}>Text inside the custom black box.</Text>
</View>
);
@@ -26,7 +26,7 @@ const BoxWithoutProps = (props: Stylable) => {
{...css(
{
backgroundColor: { xs: "#00ff00", md: "#ff0000" },
hover: { alignContent: "center" },
hover: { alignContent: "center", alignItems: "center" },
press: { alignContent: "center" },
focus: { alignContent: "center" },
},
@@ -34,13 +34,9 @@ const BoxWithoutProps = (props: Stylable) => {
)}
>
<Text
{...css(
{
backgroundColor: { xs: "#00ff00", md: "#ff0000" },
hover: { alignContent: "center" },
},
props,
)}
{...css({
backgroundColor: { xs: "#00ff00", md: "#ff0000" },
})}
>
Text inside the box without props (green on small screens, red on bigs)
</Text>
+2 -2
View File
@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for details.
//
import { Theme, ThemeProvider, useYoshiki } from "yoshiki";
import { Theme, ThemeProvider } from "yoshiki";
import { useYoshiki, useMobileHover } from "yoshiki/web";
import { AppProps } from "next/app";
import { useMobileHover } from "yoshiki";
declare module "yoshiki" {
export interface Theme {
@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for details.
//
import { StyleRegistryProvider, createStyleRegistry } from "yoshiki";
import { StyleRegistryProvider, createStyleRegistry } from "yoshiki/web";
import Document, { DocumentContext } from "next/document";
Document.getInitialProps = async (ctx: DocumentContext) => {
+1 -1
View File
@@ -5,7 +5,7 @@
import Head from "next/head";
import Image from "next/image";
import { useYoshiki, Stylable } from "yoshiki";
import { useYoshiki, Stylable } from "yoshiki/web";
import { ReactNode } from "react";
const Box = ({ children, ...props }: { children?: ReactNode } & Stylable) => {