npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

basic-styled

v0.0.9

Published

Basic CSS-in-JS library

Downloads

32

Readme

basic-styled

basic-styled 는 기초적인 스타일링 기능을 제공하는 CSS-in-JS 라이브러리예요. 고급 스타일링이나 성능이 중요하지 않은 간단한 프로젝트에 사용할 가벼운 라이브러리가 필요하시다면 사용해 보세요!

React 와 Next.js 에서만 사용할 수 있어요.

🚀 특징

  • 작은 사이즈
  • 간단한 사용
  • 의존성 없음
  • Theming 지원
  • Server-Side Rendering 지원
  • Next.js 호환

설치 및 시작

pnpm add basic-styled
import styled from 'basic-styled';

function App() {
  return (
    <Box>App</Box>
  );
}

export default App;

const Box = styled.div`
  border: 1px solid;
`;

예시

Theming

// App.tsx

import ThemeProvider from 'basic-styled/setup/ThemeProvider';

const theme = {
  palette: {
    primary: '#007bff',
  }
};

function App() {
  return (
    <ThemeProvider theme={theme}>
      App
    </ThemeProvider>
  );
}

export default App;
// with TypeScript

import "basic-styled";

declare module "basic-styled" {
  export interface BasicTheme {
    palette: {
      primary: string;
    };
  }
}

Next.js

// layout.tsx

import createBuilder from "basic-styled/setup/createBuilder";
import Providers from "./providers";

const theme = {
  palette: {
    primary: '#007bff',
  }
};

createBuilder({
  prefix: 'basic-styled', // prefix for class name, default is 'basic-styled'
  theme
});

async function RootLayout({ children }: PropsWithChildren) {
  return (
    <html lang="ko">
      <body>
        <Providers>
          {children}
        </Providers>
      </body>
    </html>
  );
}

export default RootLayout;
// providers.tsx

'use client';

import ThemeProvider from 'basic-styled/setup/ThemeProvider';

const theme = {
  palette: {
    primary: '#007bff',
  }
};

function Providers({ children }: PropsWithChildren) {
  return (
    <ThemeProvider theme={theme}>
      {children}
    </ThemeProvider>
  );
}

export default Providers;

ResetStyle

// App.tsx

import ThemeProvider from 'basic-styled/setup/ThemeProvider';
import ResetStyle from 'basic-styled/setup/ResetStyle';

const theme = {
  palette: {
    primary: '#007bff',
  }
};

function App() {
  return (
    <ThemeProvider theme={theme}>
      <ResetStyle />
      App
    </ThemeProvider>
  );
}

export default App;

GlobalStyle

// App.tsx

import styled from "basic-styled";
import ThemeProvider from 'basic-styled/setup/ThemeProvider';
import ResetStyle from 'basic-styled/setup/ResetStyle';

const theme = {
  palette: {
    primary: '#007bff',
  }
};

function App() {
  return (
    <ThemeProvider theme={theme}>
      <ResetStyle />
      <GlobalStyle />
      App
    </ThemeProvider>
  );
}

export default App;

function GlobalStyle() {
  return <StyledGlobal globalStyle />;
}

const StyledGlobal = styled.style`
  html,
  body {
    height: 100%;
  }
  #root {
    min-height: 100%;
  }
`;

데모

plandy-web (https://plandy.case-d.com)