get rid of all hard coded colors

This commit is contained in:
Felix Roos 2023-02-19 22:18:32 +01:00
parent 81b4cb2f16
commit 7994ba8b38
3 changed files with 11 additions and 16 deletions

View File

@ -57,8 +57,8 @@ export function Footer({ context }) {
<div <div
onClick={() => setActiveFooter(name)} onClick={() => setActiveFooter(name)}
className={cx( className={cx(
'h-8 px-2 text-foreground cursor-pointer hover:text-tertiary flex items-center space-x-1 border-b', 'h-8 px-2 text-foreground cursor-pointer hover:opacity-50 flex items-center space-x-1 border-b',
activeFooter === name ? 'border-foreground hover:border-tertiary' : 'border-transparent', activeFooter === name ? 'border-foreground' : 'border-transparent',
)} )}
> >
{label || name} {label || name}
@ -179,10 +179,7 @@ function ConsoleTab({ log }) {
{log.map((l, i) => { {log.map((l, i) => {
const message = linkify(l.message); const message = linkify(l.message);
return ( return (
<div <div key={l.id} className={cx(l.type === 'error' && 'text-red-500', l.type === 'highlight' && 'underline')}>
key={l.id}
className={cx(l.type === 'error' && 'text-red-500', l.type === 'highlight' && 'text-highlight')}
>
<span dangerouslySetInnerHTML={{ __html: message }} /> <span dangerouslySetInnerHTML={{ __html: message }} />
{l.count ? ` (${l.count})` : ''} {l.count ? ` (${l.count})` : ''}
</div> </div>
@ -197,7 +194,7 @@ function SamplesTab() {
<div className="break-normal w-full px-4 dark:text-white text-stone-900"> <div className="break-normal w-full px-4 dark:text-white text-stone-900">
<span>{loadedSamples.length} banks loaded:</span> <span>{loadedSamples.length} banks loaded:</span>
{loadedSamples.map(([name, samples]) => ( {loadedSamples.map(([name, samples]) => (
<span key={name} className="cursor-pointer hover:text-tertiary" onClick={() => {}}> <span key={name} className="cursor-pointer hover:opacity-50" onClick={() => {}}>
{' '} {' '}
{name}( {name}(
{Array.isArray(samples) ? samples.length : typeof samples === 'object' ? Object.values(samples).length : 1}){' '} {Array.isArray(samples) ? samples.length : typeof samples === 'object' ? Object.values(samples).length : 1}){' '}

View File

@ -69,7 +69,7 @@ export function Header({ context }) {
<button <button
onClick={handleTogglePlay} onClick={handleTogglePlay}
title={started ? 'stop' : 'play'} title={started ? 'stop' : 'play'}
className={cx(!isEmbedded ? 'p-2' : 'px-2', 'hover:text-tertiary', !started && 'animate-pulse')} className={cx(!isEmbedded ? 'p-2' : 'px-2', 'hover:opacity-50', !started && 'animate-pulse')}
> >
{!pending ? ( {!pending ? (
<span className={cx('flex items-center space-x-1', isEmbedded ? '' : 'w-16')}> <span className={cx('flex items-center space-x-1', isEmbedded ? '' : 'w-16')}>
@ -86,7 +86,7 @@ export function Header({ context }) {
className={cx( className={cx(
'flex items-center space-x-1', 'flex items-center space-x-1',
!isEmbedded ? 'p-2' : 'px-2', !isEmbedded ? 'p-2' : 'px-2',
!isDirty || !activeCode ? 'opacity-50' : 'hover:text-tertiary', !isDirty || !activeCode ? 'opacity-50' : 'hover:opacity-50',
)} )}
> >
{/* <CommandLineIcon className="w-6 h-6" /> */} {/* <CommandLineIcon className="w-6 h-6" /> */}
@ -96,7 +96,7 @@ export function Header({ context }) {
{!isEmbedded && ( {!isEmbedded && (
<button <button
title="shuffle" title="shuffle"
className="hover:text-tertiary p-2 flex items-center space-x-1" className="hover:opacity-50 p-2 flex items-center space-x-1"
onClick={handleShuffle} onClick={handleShuffle}
> >
<SparklesIcon className="w-6 h-6" /> <SparklesIcon className="w-6 h-6" />
@ -107,7 +107,7 @@ export function Header({ context }) {
<button <button
title="share" title="share"
className={cx( className={cx(
'cursor-pointer hover:text-tertiary flex items-center space-x-1', 'cursor-pointer hover:opacity-50 flex items-center space-x-1',
!isEmbedded ? 'p-2' : 'px-2', !isEmbedded ? 'p-2' : 'px-2',
)} )}
onClick={handleShare} onClick={handleShare}
@ -120,21 +120,21 @@ export function Header({ context }) {
<a <a
title="learn" title="learn"
href="./learn/getting-started" href="./learn/getting-started"
className={cx('hover:text-tertiary flex items-center space-x-1', !isEmbedded ? 'p-2' : 'px-2')} className={cx('hover:opacity-50 flex items-center space-x-1', !isEmbedded ? 'p-2' : 'px-2')}
> >
<AcademicCapIcon className="w-6 h-6" /> <AcademicCapIcon className="w-6 h-6" />
<span>learn</span> <span>learn</span>
</a> </a>
)} )}
{/* {isEmbedded && ( {/* {isEmbedded && (
<button className={cx('hover:text-tertiary px-2')}> <button className={cx('hover:opacity-50 px-2')}>
<a href={window.location.href} target="_blank" rel="noopener noreferrer" title="Open in REPL"> <a href={window.location.href} target="_blank" rel="noopener noreferrer" title="Open in REPL">
🚀 🚀
</a> </a>
</button> </button>
)} )}
{isEmbedded && ( {isEmbedded && (
<button className={cx('hover:text-tertiary px-2')}> <button className={cx('hover:opacity-50 px-2')}>
<a <a
onClick={() => { onClick={() => {
window.location.href = initialUrl; window.location.href = initialUrl;

View File

@ -11,8 +11,6 @@ module.exports = {
theme: { theme: {
extend: { extend: {
colors: { colors: {
tertiary: '#82aaff',
highlight: '#bb8800',
// codemirror-theme settings // codemirror-theme settings
background: 'var(--background)', background: 'var(--background)',
lineBackground: 'var(--lineBackground)', lineBackground: 'var(--lineBackground)',