Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

15 react tab css #22

Merged
merged 4 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ yarn add @agney/playground

```jsx
import Playground from "@agney/playground";
/* Why is there a tabs import? https://github.com/agneym/playground#why-is-there-a-reacttabs-import*/
import "@reach/tabs/styles.css";

const App = () => {
const snippet = {
Expand Down Expand Up @@ -97,6 +99,12 @@ https://blog.agney.dev/introducing-playground/
}
```

### Why is there a @react/tabs import?

Playground uses [`@reach/tabs`](https://reach.tech/tabs/) as a dependency. We could bundle the stylesheet or inject it inline on runtime. But both those options add unnecessary code if you are already using it.

_This might cause breaking changes if you have a different version of `@reach/tabs` but then I'm just expecting it to be stable along the road._

### How does module imports work?

If an NPM package exposes an endpoint for "module", then you can direcly import this package by it's name.
Expand Down
3 changes: 2 additions & 1 deletion example/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Fragment } from "react";
import React from "react";
import { render } from "react-dom";
import "babel-polyfill";
import "@reach/tabs/styles.css";
import Playground from "@agney/playground";

const App = () => {
Expand Down
22 changes: 11 additions & 11 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,24 @@
"playground"
],
"files": [
"src",
"dist"
"dist",
"README.md"
],
"author": "Agney Menon <agney@outlook.in> (@agneymenon)",
"license": "MIT",
"peerDependencies": {
"react": ">=16",
"react-dom": ">=16"
},
"dependencies": {
"@agney/react-inspector": "^4.0.0",
"@reach/auto-id": "^0.13.2",
"@reach/tabs": "^0.13.2",
"goober": "^2.0.33",
"lodash.merge": "^4.6.2",
"prism-react-renderer": "^1.2.0",
"react-simple-code-editor": "^0.11.0"
},
"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.10",
Expand All @@ -52,15 +61,6 @@
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"dependencies": {
"@agney/react-inspector": "^4.0.0",
"@reach/auto-id": "^0.13.2",
"@reach/tabs": "^0.13.2",
"goober": "^2.0.33",
"lodash.merge": "^4.6.2",
"prism-react-renderer": "^1.2.0",
"react-simple-code-editor": "^0.11.0"
},
"jest": {
"rootDir": "src"
},
Expand Down
2 changes: 0 additions & 2 deletions playground/src/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React, { FC, useState, createElement } from "react";
import { useId } from "@reach/auto-id";
import { styled, setup, DefaultTheme } from "goober";

import "@reach/tabs/styles.css";

import Editor from "./Editor";
import Result from "./Result";
import { ISnippet, IEditorTabs, IResultTabs } from "./types";
Expand Down