Skip to content

Commit 5a31771

Browse files
committed
Fixes for purge CSS
1 parent 6276a03 commit 5a31771

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

resources/scripts/components/server/Console.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ITerminalOptions, Terminal } from 'xterm';
33
import * as TerminalFit from 'xterm/lib/addons/fit/fit';
44
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
55
import { ServerContext } from '@/state/server';
6+
import styled from 'styled-components';
67

78
const theme = {
89
background: 'transparent',
@@ -35,6 +36,16 @@ const terminalProps: ITerminalOptions = {
3536
theme: theme,
3637
};
3738

39+
const TerminalDiv = styled.div`
40+
&::-webkit-scrollbar {
41+
width: 8px;
42+
}
43+
44+
&::-webkit-scrollbar-thumb {
45+
${tw`bg-neutral-900`};
46+
}
47+
`;
48+
3849
export default () => {
3950
const [ terminalElement, setTerminalElement ] = useState<HTMLDivElement | null>(null);
4051
const useRef = useCallback(node => setTerminalElement(node), []);
@@ -94,13 +105,13 @@ export default () => {
94105
<div className={'text-xs font-mono relative'}>
95106
<SpinnerOverlay visible={!connected} size={'large'}/>
96107
<div
97-
className={'rounded-t p-2 bg-black overflow-scroll w-full'}
108+
className={'rounded-t p-2 bg-black w-full'}
98109
style={{
99110
minHeight: '16rem',
100111
maxHeight: '32rem',
101112
}}
102113
>
103-
<div id={'terminal'} ref={useRef}/>
114+
<TerminalDiv id={'terminal'} ref={useRef}/>
104115
</div>
105116
<div className={'rounded-b bg-neutral-900 text-neutral-100 flex'}>
106117
<div className={'flex-no-shrink p-2 font-bold'}>$</div>

resources/styles/components/navigation.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
@apply .flex .items-center .h-full .no-underline .text-neutral-300 .px-6;
2626
transition: background-color 150ms linear, color 150ms linear, box-shadow 150ms ease-in;
2727

28+
/*! purgecss start ignore */
2829
&.active, &:hover {
2930
@apply .text-neutral-100 .bg-black;
3031
box-shadow: inset 0 -2px config('colors.cyan-700');
@@ -33,6 +34,7 @@
3334
&.active {
3435
box-shadow: inset 0 -2px config('colors.cyan-500');
3536
}
37+
/*! purgecss end ignore */
3638
}
3739
}
3840
}
@@ -43,6 +45,7 @@
4345
.items {
4446
@apply .flex .items-center .text-sm .mx-2;
4547

48+
/*! purgecss start ignore */
4649
& > a, & > div {
4750
@apply .inline-block .py-3 .px-4 .text-neutral-300 .no-underline;
4851
transition: color 150ms linear, box-shadow 150ms ease-in;
@@ -60,5 +63,6 @@
6063
box-shadow: inset 0 -2px config('colors.cyan-500');
6164
}
6265
}
66+
/*! purgecss end ignore */
6367
}
6468
}

webpack.config.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
2-
const _ = require('lodash');
32
const path = require('path');
43
const tailwind = require('tailwindcss');
54
const glob = require('glob-all');
@@ -34,7 +33,7 @@ if (isProduction) {
3433
{
3534
extractor: class {
3635
static extract (content) {
37-
return content.match(/[A-z0-9-:\/]+/g) || [];
36+
return content.match(/[A-Za-z0-9-_:\\/]+/g) || [];
3837
}
3938
},
4039
extensions: ['html', 'ts', 'tsx', 'js', 'php'],
@@ -63,7 +62,7 @@ module.exports = {
6362
path: path.resolve(__dirname, 'public/assets'),
6463
filename: isProduction ? 'bundle.[chunkhash:8].js' : 'bundle.[hash:8].js',
6564
chunkFilename: isProduction ? '[name].[chunkhash:8].js' : '[name].[hash:8].js',
66-
publicPath: _.get(process.env, 'PUBLIC_PATH', '') + '/assets/',
65+
publicPath: (process.env.PUBLIC_PATH || '') + '/assets/',
6766
crossOriginLoading: 'anonymous',
6867
},
6968
module: {
@@ -168,7 +167,7 @@ module.exports = {
168167
},
169168
devServer: {
170169
contentBase: path.join(__dirname, 'public'),
171-
publicPath: _.get(process.env, 'PUBLIC_PATH', '') + '/assets/',
170+
publicPath: (process.env.PUBLIC_PATH || '') + '/assets/',
172171
allowedHosts: [
173172
'.pterodactyl.test',
174173
],

0 commit comments

Comments
 (0)