• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Custom CSS in the DB?

Scheduled Pinned Locked Moved General Discussion
8 Posts 3 Posters 2.2k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris
    wrote on last edited by
    #1

    One interesting thing that PHPBB did (not sure if it's like this still, havnt looked in awhile) was giving you the ability to store CSS in the database.

    It would be nice to be able to just have a custom css in the options that would load regardless of what plugin, theme, version, etc was installed or upgraded.

    Right now I'm just editing the less files directly but I think it'd be an easy way to give access to CSS without the worry about losing the changes when you have to upgrade or reinstall.

    Off topic but just curious: Are there plans for an auto update feature for nodebb?

    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #2

    @theepiphany why not extending the theme, and make your sub-theme depend on the super-theme,

    if that's not an option, why not a custom .css file in, and just a path to it in the DB? then inject it.
    well, either way, you can do that with a plugin too, by injecting your CSS in a <style> or <link> tag in the footer. (since the filter:header.build is currently limited to push items on the navigation bar.)

    You do not need to update the .less files.

    am i missing something? or did that answer your question.

    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #3
    This post is deleted!
    1 Reply Last reply
    0
  • C Offline
    C Offline
    Chris
    wrote on last edited by
    #4

    @bentael said:

    @theepiphany why not extending the theme, and make your sub-theme depend on the super-theme,

    if that's not an option, why not a custom .css file in, and just a path to it in the DB? then inject it.
    well, either way, you can do that with a plugin too, by injecting your CSS in a <style> or <link> tag in the footer. (since the filter:header.build is currently limited to push items on the navigation bar.)

    You do not need to update the .less files.

    am i missing something? or did that answer your question.

    That's actually what I'm doing now is moving all of my changes into my own sub theme. It was just a random thought I had while I was doing it, so figured I'd bring it up since it's very likely folks will be happy with the vanilla nodebb install and probably be mostly happy with all of the themes sure to come but maybe wanting to make one or two minor color changes. Would make it fairly simple for people who don't want to mess around with the files themselves.

    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by bentael
    #5

    @theepiphany gotcha!

    for that specific purpose, I would use a plugin, this one, nodebb-plugin-42, (current screen shot - plugin needs a code refactor, but works for today), it lets u prepend anything to the <footer>, and append anything to the <body>, i probably should add append to the <head>.

    1 Reply Last reply
    0
  • S Offline
    S Offline
    StuartH
    wrote on last edited by
    #6

    @bentael said:

    @theepiphany gotcha!

    for that specific purpose, I would use a plugin, this one, nodebb-plugin-42, (current screen shot - plugin needs a code refactor, but works for today), it lets u prepend anything to the <footer>, and append anything to the <body>, i probably should add append to the <head>.

    Looking forward to trying this soon, just waiting for the plugin to be installed then I can finish sorting out the layout.

    1 Reply Last reply
    0
  • C Offline
    C Offline
    Chris
    wrote on last edited by
    #7

    @bentael I was looking at that yesterday. Very nice plugin.

    For the less experienced users, maybe add a "Custom CSS" option that automatically puts in the <style> tags at the beginning and </style> at the end, then use tell codemirror to use css styling for that box.

    Either way I'm going to be installing it later today 🙂

    1 Reply Last reply
    0
  • B Offline
    B Offline
    bentael Plugin & Theme Dev
    wrote on last edited by
    #8

    @Chris I will add this styling this weekend, I'm also gotta fix up the plugin a little, the way I load the settings is a little hacky. .. so you can always update 🙂

    1 Reply Last reply
    0
  • F felipemoslavacz referenced this topic on

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development