Skip to content

Commit

Permalink
Update CSSRuntimeProvider imports
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Mar 3, 2024
1 parent 5e6197f commit 68cb136
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 50 deletions.
2 changes: 1 addition & 1 deletion examples/next.js-with-runtime-rendering/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './globals.css'
import { CSSRuntimeProvider } from '@master/css.react'
import CSSRuntimeProvider from '@master/css.react'
import config from '../master.css'

export const metadata = {
Expand Down
2 changes: 1 addition & 1 deletion examples/next.js/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './globals.css'
import { CSSRuntimeProvider } from '@master/css.react'
import CSSRuntimeProvider from '@master/css.react'
import config from '../master.css'

export const metadata = {
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt.js-with-runtime-rendering/app.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { CSSRuntimeProvider } from '@master/css.vue'
import CSSRuntimeProvider from '@master/css.vue'
import config from './master.css'
</script>

Expand Down
2 changes: 1 addition & 1 deletion examples/react-with-static-extraction/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="./src/index.css" rel="stylesheet" />
</head>

<body class="bg:gray-10@dark bg:white@light fg:white@dark fg:slate-20@light">
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
Expand Down
14 changes: 6 additions & 8 deletions examples/react-with-static-extraction/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ function App() {
return (
<>
<div className='grid-cols:2 w:fit mx:auto'>
<a href="https://rc.css.master.co" target="_blank">
<img src={masterLogo} className="logo master scale(2)" alt="Master logo" />
</a>
<a href="https://reactjs.org" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
<a href="https://rc.css.master.co" target="_blank">
<img src={masterLogo} className="logo master scale(1.6)" alt="Master logo" />
</a>
</div>
<h1 className="font:sans ls:-.25 fg:white@dark font:heavy">
<span className="fg:#00D8FF">React</span>
<span className="fg:slate-70 mx:10 font:semibold">+</span>
<span>Master CSS</span>
<h1 className="font:sans ls:-.25 font:heavy">
<span>Master CSS</span> <span className="fg:#00D8FF">React</span>
</h1>
<div className="card">
<button className="h:40 bg:gray-20@dark bg:slate-90@light" onClick={() => setCount((count) => count + 1)}>
<button className="h:40" onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href="./src/index.css" rel="stylesheet" />
</head>

<body class="bg:gray-10@dark bg:white@light fg:white@dark fg:slate-20@light">
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
Expand Down
12 changes: 5 additions & 7 deletions examples/react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ function App() {
return (
<>
<div className='grid-cols:2 w:fit mx:auto'>
<a href="https://rc.css.master.co" target="_blank">
<img src={masterLogo} className="logo master scale(2)" alt="Master logo" />
</a>
<a href="https://reactjs.org" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
<a href="https://rc.css.master.co" target="_blank">
<img src={masterLogo} className="logo master scale(1.6)" alt="Master logo" />
</a>
</div>
<h1 className="font:sans ls:-.25 fg:white@dark font:heavy">
<span className="fg:#00D8FF">React</span>
<span className="fg:slate-70 mx:10 font:semibold">+</span>
<span>Master CSS</span>
<span>Master CSS</span> <span className="fg:#00D8FF">React</span>
</h1>
<div className="card">
<button className="h:40 bg:gray-20@dark bg:slate-90@light" onClick={() => setCount((count) => count + 1)}>
<button className="h:40 bg:gray-80" onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
</div>
Expand Down
21 changes: 0 additions & 21 deletions examples/react/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
}
}

@media (prefers-reduced-motion: no-preference) {
.logo.react {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}
Expand Down Expand Up @@ -107,18 +101,3 @@ button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}

a:hover {
color: #747bff;
}

button {
background-color: #f9f9f9;
}
}
2 changes: 1 addition & 1 deletion examples/react/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'
import { CSSRuntimeProvider } from '@master/css.react'
import CSSRuntimeProvider from '@master/css.react'
import config from '../master.css'

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { CSSRuntimeProvider } from "@master/css.svelte";
import CSSRuntimeProvider from "@master/css.svelte";
import config from "../../master.css";
import Header from "./Header.svelte";
import "./styles.css";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import ProgressiveRenderingIntro from '../../rendering-modes/components/Progress
lang: 'tsx',
code: `
import './globals.css'
+import { CSSRuntimeProvider } from '@master/css.react'
+import CSSRuntimeProvider from '@master/css.react'
+import config from '../master.css'
export const metadata = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import RuntimeRenderingIntro from '../../../rendering-modes/components/RuntimeRe
lang: 'tsx',
code: `
import './globals.css'
+import { CSSRuntimeProvider } from '@master/css.react'
+import CSSRuntimeProvider from '@master/css.react'
+import config from '../master.css'
export const metadata = {
Expand All @@ -126,7 +126,7 @@ import RuntimeRenderingIntro from '../../../rendering-modes/components/RuntimeRe
code: `
import '../styles/globals.css'
import type { AppProps } from 'next/app'
+import { CSSRuntimeProvider } from '@master/css.react'
+import CSSRuntimeProvider from '@master/css.react'
+import config from '../master.css'
export default function App({ Component, pageProps }: AppProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import RuntimeRenderingIntro from '../../../rendering-modes/components/RuntimeRe
<StepR>
```html name=app.vue
<script setup lang="ts">
+import { CSSRuntimeProvider } from '@master/css.vue'
+import CSSRuntimeProvider from '@master/css.vue'
+import config from './master.css'
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ A full-stack framework, such as [Next.js](/docs/installation/nextjs), [Remix](/d
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'
+import { CSSRuntimeProvider } from '@master/css.react'
+import CSSRuntimeProvider from '@master/css.react'
+import config from '../master.css'

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import RuntimeRenderingIntro from '../../../rendering-modes/components/RuntimeRe
<StepR>
```svelte name=src/routes/%2Blayout.svelte
<script>
+ import { CSSRuntimeProvider } from "@master/css.svelte";
+ import CSSRuntimeProvider from "@master/css.svelte";
+ import config from '../../master.css';
import Header from "./Header.svelte";
import "./styles.css";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ A full-stack framework, such as [Nuxt.js](/docs/installation/nuxtjs), is recomme
<StepR>
```html name=src/App.vue
<script setup lang="ts">
+import { CSSRuntimeProvider } from '@master/css.vue'
+import CSSRuntimeProvider from '@master/css.vue'
+import config from '../master.css'
</script>

Expand Down

0 comments on commit 68cb136

Please sign in to comment.