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

Custom Theme-ability... #29

Open
rchrdnsh opened this issue Jun 19, 2023 · 13 comments
Open

Custom Theme-ability... #29

rchrdnsh opened this issue Jun 19, 2023 · 13 comments
Labels
enhancement New feature or request

Comments

@rchrdnsh
Copy link

I would absolutely love to be able to customize the look and feel of the CMS UI in the following ways:

  • Typography
  • Colors
    • Toolbar Color
    • Toolbar Font Color
  • Logo
  • Spacing
    • Input Field height and border-radius
    • List row height
    • Paragraph Height
    • Line Height
    • Metadata spacing
    • other things I cannot think of at the moment
  • Font Size Everywhere

I would basically love the ability to customize the general look and feel for clients and configure all that in a css file or something...

Please consider this in the near future, thank you ( ありがとう :-)

@kyoshino
Copy link
Member

kyoshino commented Jun 19, 2023

Not sure if I can do it in the near future, but it makes sense. I also have clients using Sveltia CMS (as is). WIll put this on my to-do list!

@rchrdnsh
Copy link
Author

yeah, was hacking around in the dev tools, to show you an example:

Screenshot 2023-06-19 at 6 20 03 PM

...but maybe having an app.css file that is exposed or something with a list of the custom properties needed to do something like the above picture would be super awesome :-)

Brand colors and adjusting spacing and fonts, etc...

Thank you for all your work on this project, Netlify CMS has been failing more and more for us :-)

@rchrdnsh
Copy link
Author

TBH cannot use it until Rich Text Editing is in place, because of the non technical people that would be using it, but excited for that day to come :-)

@rchrdnsh
Copy link
Author

Been messing around with CMS ideas myself in the last year or so:

https://svelte.dev/repl/14075540b84440008848739b6fcb70a1?version=3.59.1

XD

@rchrdnsh
Copy link
Author

messed around with the layout of the editor without the preview on...

Screenshot 2023-06-19 at 9 03 17 PM

set a width on the 'content' div, made it grid and gap'd everything, removed the horizontal lines from each section as they looked a bit funny when not running from each to edge and made the heights and spacing more comfy and forgiving :-)

Not sure what to do about the three vertical dots...they feel...odd...no better solution ATM, tho :-)

@rchrdnsh
Copy link
Author

I think most things are controlled by css custom properties, so maybe being able to override the interval style sheet with another user generated one might be all that I need for now...dunno how easy that would be to include, of course :-)

@kyoshino
Copy link
Member

kyoshino commented Jun 20, 2023

Yeah, some basic colours, fonts, etc. are written with CSS variables, so you can override them by adding a stylesheet to /admin/index.html where sveltia-cms.js is loaded 😺 Later I’ll make everything customizable.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="robots" content="noindex" />
    <title>Sveltia CMS</title>
  </head>
  <body>
    <script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js" type="module"></script>
    <style>
      body {
        --font-family--default: Verdana;
        /* and whatever */
      }
    </style>
  </body>
</html>

@kyoshino kyoshino self-assigned this Jun 20, 2023
@kyoshino kyoshino added the enhancement New feature or request label Jun 20, 2023
@rchrdnsh
Copy link
Author

great, thank you XD

@kyoshino
Copy link
Member

kyoshino commented Jun 20, 2023

Well, I need to say, Sveltia UI is still early/private beta with no documentation, and some (many) of these property names may probably change without notice in a couple of months. My plan is to ship the first public beta by August. CSS variables are very convenient anyway!

@rchrdnsh
Copy link
Author

no worries, you are doing amazing stuff so far and I am very grateful for this :-)

@rchrdnsh
Copy link
Author

ok, got some custom menu styles going:

Screenshot 2023-06-20 at 12 07 14 PM

With some css that took a little effort to figure out 🤣

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>Content Manager</title>
  </head>
  <body>
    <!-- Include the script that builds the page and powers Netlify CMS -->
    <!-- <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script> -->
    <script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js" type="module"></script>
    <style>
      body {
        --tertiary-background-color: white;
        --font-family--default: Varela Round;
      }
      .outer > .toolbar-wrapper > .sui.toolbar.horizontal {
        background-color: hsl(220, 40%, 40%);
      }
      .outer > .toolbar-wrapper > .sui.toolbar.horizontal > button:hover {
        background-color: hsl(220, 40%, 60%);
      }
      .outer > .toolbar-wrapper > .sui.toolbar.horizontal > button[aria-pressed="true"] {
        background-color: hsl(220, 40%, 50%);
      }
      .outer > .toolbar-wrapper > .sui.toolbar.horizontal > button > span {
        color: white;
      }
    </style>
  </body>
</html>

...but so far so good :-)

@rchrdnsh
Copy link
Author

hmmm...I was thinking...maybe just add custom theming classes to the elements in the cms...like...haven't thought this through too much, but simply adding some classes to elements and not styling to those classes. so that I could create a css file like and grab horizontal-toolbar for example, then style away...

not sure how easy and/or feasible that is, though...

and/or css custom properties for more of a configuration approach...

@naton
Copy link

naton commented Oct 2, 2023

One way to migrate to more variables is to skip adding them in a centralized place (for now) and just start using them where fit, with current values as fallback. E.g. 4px would become var(--gap-s, 4px) or something, making it overrideable for others via the --gap-s variable. Just an example.

@kyoshino kyoshino removed their assignment Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants