Skip to content

Commit c2ac963

Browse files
authored
Merge pull request #723 from acelaya-forks/feature/stable-frontend-kit
Feature/stable frontend kit
2 parents 523b731 + 703d6f2 commit c2ac963

File tree

127 files changed

+827
-918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+827
-918
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org).
66

7-
## [Unreleased]
7+
## [0.15.0] - 2025-06-17
88
### Added
99
* *Nothing*
1010

1111
### Changed
12-
* *Nothing*
12+
* [#661](https://github.com/shlinkio/shlink-web-component/issues/661) Update to shlink-frontend-kit 1.0.0
13+
* No longer use `!important` with tailwind styles
1314

1415
### Deprecated
1516
* *Nothing*

README.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,23 +150,13 @@ export function App() {
150150

151151
### Styles
152152

153-
Currently, this component depends on `bootstrap`, `@shlinkio/shlink-frontend-kit` and its own stylesheets for proper styling, although bootstrap is being replaced by `tailwind`.
154-
155-
Make sure you import stylesheets in the order documented here for everything to work.
156-
157-
```scss
158-
// src/index.scss
159-
@use 'node_modules/@shlinkio/shlink-frontend-kit/dist/base'; // Before bootstrap stylesheet
160-
@use 'node_modules/bootstrap/scss/bootstrap.scss' with (
161-
$primary: base.$mainColor // Override bootstrap's primary color
162-
);
163-
@use 'node_modules/@shlinkio/shlink-frontend-kit/dist/index'; // After bootstrap. Includes CSS overrides
164-
@use 'node_modules/@shlinkio/shlink-web-component/dist/index' as c-index;
165-
```
153+
Currently, this component depends on `tailwind` and `@shlinkio/shlink-frontend-kit` for proper styling.
154+
155+
Make sure you import stylesheets as documented here for everything to work.
166156

167157
```css
168158
/* src/tailwind.css */
169-
@import 'tailwindcss' prefix(tw);
159+
@import 'tailwindcss';
170160

171161
/* Add these three lines */
172162
@source '../node_modules/@shlinkio/shlink-frontend-kit';
@@ -180,8 +170,7 @@ import type { Theme } from '@shlinkio/shlink-frontend-kit';
180170
import { Checkbox, changeThemeInMarkup } from '@shlinkio/shlink-frontend-kit';
181171
import { ShlinkWebComponent } from '@shlinkio/shlink-web-component';
182172
import { useCallback, useState } from 'react';
183-
import './src/index.scss'; // The stylesheet above
184-
import './src/tailwind.css'; // The Tailwind stylesheet above
173+
import './src/tailwind.css'; // The stylesheet above
185174

186175
export function App() {
187176
const [theme, setTheme] = useState<Theme>('light');

dev/App.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@ export const App: FC = () => {
4242
<>
4343
<header
4444
className={clsx(
45-
'tw:fixed tw:top-0 tw:left-0 tw:right-0 tw:z-1000',
46-
'tw:h-(--header-height) tw:flex tw:justify-between',
47-
'tw:bg-lm-main tw:dark:bg-dm-main tw:text-white',
45+
'fixed top-0 left-0 right-0 z-1000',
46+
'h-(--header-height) flex justify-between',
47+
'bg-lm-main dark:bg-dm-main text-white',
4848
)}
4949
>
5050
<ServerInfoForm serverInfo={serverInfo} onChange={onServerInfoChange} />
51-
<div className="tw:h-full tw:pr-4 tw:flex tw:items-center tw:gap-4">
52-
<Link to="/" className="tw:text-white">Home</Link>
53-
<Link to="/settings" className="tw:text-white">Settings</Link>
51+
<div className="h-full pr-4 flex items-center gap-4">
52+
<Link to="/" className="text-white">Home</Link>
53+
<Link to="/settings" className="text-white">Settings</Link>
5454
<ThemeToggle />
5555
</div>
5656
</header>
57-
<div className="tw:py-(--header-height)">
57+
<div className="py-(--header-height)">
5858
<Routes>
5959
<Route path="/settings">
6060
<Route
6161
path="*"
6262
element={(
63-
<div className="tw:container tw:mx-auto tw:pt-6">
63+
<div className="container mx-auto pt-6">
6464
<ShlinkWebSettings
6565
settings={settings}
6666
onUpdateSettings={setSettings}
@@ -80,9 +80,9 @@ export const App: FC = () => {
8080
settings={settings}
8181
routesPrefix={routesPrefix}
8282
/>
83-
) : <div className="tw:container tw:mx-auto tw:pt-6">Not connected</div>}
83+
) : <div className="container mx-auto pt-6">Not connected</div>}
8484
/>
85-
<Route path="*" element={<h3 className="tw:mt-4 tw:text-center">Not found</h3>} />
85+
<Route path="*" element={<h3 className="mt-4 text-center">Not found</h3>} />
8686
</Routes>
8787
</div>
8888
</>

dev/ThemeToggle.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Theme } from '@shlinkio/shlink-frontend-kit';
2-
import { changeThemeInMarkup } from '@shlinkio/shlink-frontend-kit';
3-
import { Label, ToggleSwitch } from '@shlinkio/shlink-frontend-kit/tailwind';
2+
import { changeThemeInMarkup , Label, ToggleSwitch } from '@shlinkio/shlink-frontend-kit';
43
import type { FC } from 'react';
54
import { useCallback, useState } from 'react';
65

@@ -19,7 +18,7 @@ export const ThemeToggle: FC = () => {
1918
}, []);
2019

2120
return (
22-
<Label className="tw:flex tw:items-center tw:gap-x-1.5">
21+
<Label className="flex items-center gap-x-1.5">
2322
<ToggleSwitch checked={checked} onChange={toggleTheme} /> Dark theme
2423
</Label>
2524
);

dev/index.scss

Lines changed: 0 additions & 3 deletions
This file was deleted.

dev/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createRoot } from 'react-dom/client';
22
import { BrowserRouter } from 'react-router';
33
import { App } from './App';
4-
import './index.scss';
54
import './tailwind.css';
65

76
createRoot(document.getElementById('root')!).render(

dev/server-info/ServerInfoForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Button, Input } from '@shlinkio/shlink-frontend-kit/tailwind';
1+
import { Button, Input } from '@shlinkio/shlink-frontend-kit';
22
import type { FC, FormEvent } from 'react';
33
import { useCallback } from 'react';
44
import type { ServerInfo } from './useServerInfo';
@@ -24,7 +24,7 @@ export const ServerInfoForm: FC<ServerInfoFormProps> = ({ serverInfo, onChange }
2424
}, [serverInfo]);
2525

2626
return (
27-
<form className="tw:py-2 tw:pl-2 tw:flex tw:gap-2" onSubmit={handleSubmit}>
27+
<form className="py-2 pl-2 flex gap-2" onSubmit={handleSubmit}>
2828
<Input
2929
name="baseUrl"
3030
placeholder="Server URL"

dev/tailwind.css

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
@import 'tailwindcss' prefix(tw) important;
1+
@import 'tailwindcss';
22
@source '../node_modules/@shlinkio/shlink-frontend-kit';
33
@import '@shlinkio/shlink-frontend-kit/tailwind.preset.css';
44
@import '../src/tailwind.preset.css';
5-
6-
@layer base {
7-
:root {
8-
/* Temp alias fo header-height to tw-header-height, so that shlink-web-component uses the right value */
9-
--header-height: var(--tw-header-height);
10-
}
11-
}

0 commit comments

Comments
 (0)