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

feat: add styles to bundle, and rm inject styles #31

Merged
merged 1 commit into from
Sep 24, 2024
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
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"style": "./dist/styles.css",
"license": "MIT",
"files": [
"dist",
"README.md"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": "./dist/index.js"
},
"./icons": {
"types": "./dist/icons.d.ts",
"import": "./dist/icons.mjs",
"require": "./dist/icons.js",
"types": "./dist/icons.d.ts"
}
"require": "./dist/icons.js"
},
"./styles.css": "./dist/styles.css"
},
"homepage": "https://github.com/bitcoin-dev-project/bdp-ui",
"repository": {
Expand Down
2 changes: 0 additions & 2 deletions src/components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// src/components/Button/Button.tsx

import React from "react";
import "../../styles/tailwind.output.css";

export interface ButtonProps {
label: string;
onClick?: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface FooterRootProps
}

const Separator = () => (
<div className="h-5 border xl:h-6 xl:border-2 border-custom-stroke hidden xl:block" />
<div className="h-5 border xl:h-6 xl:border-2 border-bdp-stroke hidden xl:block" />
);

const Footer: React.FC<FooterRootProps> & {
Expand Down
2 changes: 1 addition & 1 deletion src/components/footer/FooterAbout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const FooterAbout = (props: React.PropsWithChildren<FooterAboutProps>) => {
href={entityLink ?? "https://bitcoindevs.xyz/"}
target="_blank"
rel="noreferrer"
className="underline font-medium text-custom-brightOrange-100"
className="underline font-medium text-bdp-brightOrange-100"
>
{entityName ?? "Bitcoin Dev Project"}
</a>
Expand Down
12 changes: 1 addition & 11 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,9 @@ module.exports = {
darkMode: "class",
content: ['./src/**/*.{js,jsx,ts,tsx}'],
theme: {
fontFamily: {
sans: ["ui-sans-serif", "system-ui"],
serif: ["ui-serif", "Georgia"],
mono: ["ui-monospace", "SFMono-Regular"],
geist: ['"Geist Sans"', "sans-serif"],
mona: ['"Mona Sans"', "sans-serif"],
},
extend: {
boxShadow: {
"custom-sm": "2px 3px 10px 0px rgba(255, 128, 0, 0.18);",
},
colors: {
custom: {
bdp: {
background: "var(--background)",
"hover-primary": "var(--hover-primary)",
"hover-state": "var(--hover-state)",
Expand Down
6 changes: 5 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from 'tsup';
import fs from 'fs';

export default defineConfig({
entry: ['src/index.ts', 'src/icons.ts'],
Expand All @@ -9,5 +10,8 @@ export default defineConfig({
sourcemap: true,
clean: true,
external: ['react', 'react-dom'],
injectStyle: true,
injectStyle: false,
async onSuccess() {
await fs.promises.copyFile('src/styles/tailwind.output.css', 'dist/styles.css');
},
});
Loading