mirror of
https://github.com/zoriya/yoshiki.git
synced 2026-06-05 03:19:50 +00:00
Add a merged style to check types of react and native at the same time
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user