GithubHelp home page GithubHelp logo

cssx's Introduction

mdx-cssx

https://cssx.netlify.com

CSSX is CSS in MDX files.

Why?

Why not?

Usage

yarn add mdx-cssx
npm i mdx-cssx
import ReactDOM from "react-dom"
import React from "react"
import App from "./App"
import CSSX from "mdx-cssx"

ReactDOM.render(
  <CSSX>
    <App />
  </CSSX>,
  document.getElementById("root")
)

Under the hood I use the mdx-provider so you can pass more components to it if you wish to override more

Then use it in your MDX files like so:

# CSSX

CSSX is CSS in MDX

it uses emotion under the hood to create the styles.

## Why?

Why not?

```cssx
body {
    background: #d9d9d9;
    padding: 20px;
    justify-content: center;
    display: flex;
    height: 100vh;
    align-items: center;
    text-align: center;
}

h1 {
  color: blue;
}

pre {
  text-align: left;
}

Build note:

The example included in the project uses Yarn workspaces to include the compiled file. The index.js in the workspace is the content from the dist folder when you run the build command.

See a local example

A local example is included in the cssx-example folder

...

License

MIT License, see the included License.md file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.