Skip to content

Commit

Permalink
Try to reduce theme styles
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarrough committed Oct 27, 2023
1 parent c0f87e4 commit 099549e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 82 deletions.
54 changes: 11 additions & 43 deletions public/themes/classic.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
r4-app {
--s-font: 15px;
--s: 1rem;
--s-radius: 3px;
--s-radius: 4px;
--font: Maison Neue, system-ui, sans-serif;
--s-line-height: 1.3125;
--c-light: hsl(0deg 0% 98%);
Expand All @@ -12,6 +12,7 @@ r4-app {
--c-light--accent: var(--c-purple);
--c-dark--accent: #9c8fff;
--c-link: var(--c-purple);
--c-border: rgba(115, 115, 115, 0.4);

/* new vars */
--c-bg-button: hsl(0, 0%, 98%);
Expand All @@ -28,7 +29,7 @@ r4-app button {
display: inline-block;
font-size: 0.86667rem;
font-weight: bold;
border: 1px solid rgba(115, 115, 115, 0.4);
border: 1px solid var(--c-border);
border-radius: var(--s-radius);
box-shadow: 0 3px 0 -1px rgba(204, 204, 204, 0.9);
box-sizing: border-box;
Expand All @@ -47,21 +48,6 @@ r4-app[color-scheme='dark'] button {
box-shadow: none;
}

r4-channel-card {
--c-border: rgba(115, 115, 115, 0.4);
}

/* Control the header sizes */
r4-app h1 {
font-size: 2rem;
}
r4-app h2 {
font-size: 1.5rem;
}
r4-app h3 {
font-size: 1rem;
}

/* Differentiate channels and track lists by using a grid */
r4-page-explore r4-page-main > r4-list {
display: grid;
Expand All @@ -70,39 +56,21 @@ r4-page-explore r4-page-main > r4-list {
align-items: stretch;
}

r4-channel-card r4-channel-slug {
display: none;
}
r4-channel-card r4-channel-description {
margin-left: 0.5em;
}

r4-track-title a {
color: var(--text);
}

/* Ordinary menus */
/* Nav menus */
r4-app-menu a,
r4-page-channel r4-page-header > menu a {
padding: var(--s) calc(var(--s) / 2);
}

r4-track a {
text-decoration: none;
}

r4-list-item r4-track {
position: relative;
border-bottom: 1px solid var(--c-border);
padding: calc(var(--s) / 2) 0;
gap: calc(var(--s) / 2);
/* Channel cards */
r4-channel-card r4-channel-slug {
display: none;
}

r4-list-item r4-track r4-actions {
margin-left: 0.5em;
position: absolute;
top: 0;
right: var(--s);
r4-list-item r4-track-title a {
color: var(--c-fg);
padding: 0 var(--s);
text-decoration: none;
}

/* Maison Neue regular/italic + bold/italic from Cloudinary */
Expand Down
6 changes: 0 additions & 6 deletions public/themes/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ r4-app summary {
r4-list-item + r4-list-item {
margin-top: var(--s);
}
r4-list-item > r4-track {
flex: 1;
}

r4-track-description::before,
r4-track-discogs-url::before,
r4-track-mentions menu::before,
Expand All @@ -55,8 +51,6 @@ r4-channel-url::before {
r4-track-mentions a::before,
r4-track-tags a::before {
color: var(--c-bg);
padding-left: calc(var(--s) / 2);
padding-right: calc(var(--s) / 2);
}

r4-app r4-layout::part(controls-button) {
Expand Down
53 changes: 21 additions & 32 deletions public/themes/jellybeans.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/**
* The Jellybeans Theme
* inspired the vim theme of the same name.
*
* Light and dark color schemes
* Lots of button styles
* Tags and Mentions as "pills"
* Grid of channel cards
*/

r4-app {
Expand Down Expand Up @@ -158,14 +163,14 @@ r4-app button:not(disabled):hover,
r4-app select:not(disabled):hover {
background: var(--c-bg3);
}

/* Primary buttons */
r4-app button[type='submit'] {
background-color: var(--c-green5);
}
r4-app button[type='submit']:hover {
background-color: var(--c-green4);
}

r4-app[color-scheme='dark'] button[type='submit'] {
background-color: var(--c-green7);
}
Expand Down Expand Up @@ -206,12 +211,18 @@ r4-channel-card r4-channel-description {
}

/* Track lists */
r4-list-item r4-track {
border-bottom: 1px solid var(--c-border);
padding: calc(var(--s) / 2) 0;
}
r4-track-title,
r4-track-description {
font-size: 14px;
}
r4-track-title a {
color: var(--c-fg);
text-decoration: none;
margin: 0 0.5em;
}
[color-scheme='dark'] r4-track-title a {
color: var(--c-gray2);
Expand All @@ -224,19 +235,13 @@ r4-track-description {
}
/* Tracklist layout for smaller screens */
@media (max-width: 700px) {
r4-track-tags,
r4-track-mentions {
r4-list-item r4-track-tags,
r4-list-item r4-track-mentions {
display: none;
}
}

/* Channels */
r4-channel-name {
font-size: 1.25rem;
}
r4-channel-description {
display: block;
margin-left: 0.5em;
r4-list-item r4-actions {
margin-left: auto;
}

/* Tags and mentions aka labels */
Expand All @@ -254,15 +259,6 @@ r4-app[color-scheme='dark'] a[label] {
color: var(--c-green3);
}

/* Channel page */
r4-channel-name {
font-size: 1.25rem;
}
r4-page-channel r4-page-header r4-channel-name {
/* Like <h1> */
font-size: 2rem;
}

/* Differentiate channels and track lists by using a grid */
r4-page-explore r4-page-main > r4-list {
display: grid;
Expand All @@ -271,10 +267,11 @@ r4-page-explore r4-page-main > r4-list {
align-items: stretch;
}

r4-list-item r4-track {
border-bottom: 1px solid var(--c-border);
padding: calc(var(--s) / 2) 0;
gap: calc(var(--s) / 2);
r4-page-channel r4-page-header r4-channel-name {
font-size: 2rem;
}
r4-channel-name {
font-size: 1.25rem;
}

/* Ordinary menus */
Expand All @@ -283,10 +280,6 @@ r4-page-channel r4-page-header > menu a {
padding: var(--s) calc(var(--s) / 2);
}

r4-track a {
text-decoration: none;
}

/* Player styles */
r4-layout::part(playback-summary) {
/* background: var(--c-link); */
Expand All @@ -309,7 +302,3 @@ radio4000-player .PlayerControl-group .Btn {
background-color: var(--c-link) !important;
}

/* Inside lists */
r4-list-item r4-actions {
margin-left: auto;
}
1 change: 1 addition & 0 deletions public/themes/minimal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Nothing here. This is like not choosing a theme. */
2 changes: 2 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ r4-app {
/* reference functional variables using the colors */
--c-fg: inherit;
--c-bg: inherit;
--c-light: inherit;
--c-dark: inherit;
}

r4-app[color-scheme='dark'] {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/appearence.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const THEMES = ['default', 'classic', 'jellybeans']
const THEMES = ['minimal', 'default', 'classic', 'jellybeans']
const COLOR_SCHEMES = ['os', 'light', 'dark']
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches

Expand Down

0 comments on commit 099549e

Please sign in to comment.