Search this blog
themes
menu
  • Showing 24 posts tagged general coding answers
    answer post by
    Anonymous sent a message

    Question: Is it easy to add a dark/light switch to themes? (I think I know the answer, but thought I would ask lol.) I bounce back and forth a lot between wanting a dark or light theme, and it would be a lot easier to just hit a switch on my preferred themes (which are all yours) than going into the editor every time I want to change it up. Alternatively, do you have any recommendations for themes with a dark/light switch? Thanks!

  • seyche replied

    it’s pretty simple, especially since there’s tons of tutorials online and most of it is just changing the colours of stuff in the CSS. if you want to add one to a theme, you’ll also need to know how to use your browser’s inspect element tool, but again, there’s lots of explainers on how to use it. it’s more time-consuming than complicated. I have a tag for themes with night mode but it’s very sparse since I only just started that tag.

  • link copied
    answer post by
    Anonymous sent a message

    this is a general question, is there a way to set the meta tags for rgb colors? It uses the hex code so I could set the different opacity for each background

  • seyche replied

    {RGBcolor:name} is what you’re looking for.

    it’s used like… color: rgba({RGBcolor:name}, 0.5);

  • link copied
    answer post by
    Anonymous sent a message

    Weird question I know, but I recently found out there are blogs that are inaccessible thru web proxies and that you can only access normally thru /archive because they force a page on visitors no matter what you do and like… mood? Do you have any tutorial on how to do that? I am a sex worker and I value my privacy a lot, obviously, and I didn’t know about this and it’d be really useful for my business. Thanks!

  • seyche replied

    sorry I’m a web design noob and I don’t know quite what you mean by a proxy…. not sure if this is what you meant, but it’s totally possible to make your blog posts only viewable from the archive and/or force people to look at a certain page on your blog! i.e. if you install a page theme on your regular blog or your theme HTML support posts, desktop viewers will only be able to see the page no matter what URL they go on. so people will be able to look at your archive if they go to /archive but if they click on the post permalink, they won’t see the actual post, just the page code you’ve got on top of it.

    you can also use this redirect script to force certain pages on users. like, I use it on my /ask page to redirect anyone who goes to /ask to my faq. I think that sounds like what you might be looking for?

    I will note that I’ve heard of cases with blogs that use a bunch of redirect scripts getting taken down in the past (as in a few years ago). I don’t know of any recent cases and I and many other thememakers use redirects all the time without issue, but thought I’d mention that just because tumblr has been shitty about sex workers :/ but even if you didn’t go that route, replacing your regular theme HTML with a page would definitely force your users to look at that page no matter what url they went to.

  • link copied
    answer post by
    Anonymous sent a message

    hii!! first, thanks for your themes!! they inspired me to try coding again!! (i used to code in neopets (layouts/pet pages) when i was a child but i stopped doing it long time ago lol) now i'm trying to make a fansite theme, and i'm curious, is there a way to show up who's positng on the blog (like which member posted/reblogged a post)? i saw it in some themes and i'm trying to find the code in guides but i can't find any :(, thanks in advance!!

  • seyche replied

    oh that’s lovely to hear! good luck with your return to coding :)

    it’s the post authors blocks, which you can find listed under the “group blogs” section of Tumblr’s documentation.

  • link copied
    answer post by
    Anonymous sent a message

    hello! is it possible for me to change the colors of the tumblr controls on both desktop and mobile?

  • seyche replied

    on mobile - no, because to my knowledge the mobile theme override in the app won’t let you do it. on desktop, you can do it with the filter property, i.e. like this:

    .tmblr-iframe-compact .tmblr-iframe–unified-controls {

    -webkit-filter: invert(100%);

    -o-filter: invert(100%);

    -moz-filter: invert(100%);

    -ms-filter: invert(100%);

    filter: invert(100%);

    }

    there’s a bunch of different ways to use that property though.

  • link copied
    answer post by
    Anonymous sent a message

    hello, this is kind of a random question but i've been interested in making tumblr themes as i had previous experience with blogspot, but seeing how many theme makers had posted about how many times tumblr had changed their code to become even more painful to deal with, i'm kind of intimidated... is it best to start out by making custom pages instead, as they don't deal with stuff like npf photosets and other complicated code? or pages are harder than normal themes? thanks a bunch t___t

  • seyche replied

    I know some theme makers have started out that way because you don’t really have to deal with any of the Tumblr specific variables, so you don’t have to really deal with changes affecting your code, and pages are solely reliant on HTML/CSS. it’s definitely less arduous. but for learning, I don’t think there’s a “best” way, it just depends on what you feel most comfortable with. I never made a page until I’d been coding themes for myself for years simply because I never used them, and being able to use my codes myself and test them out really helped me to learn. even now, I much prefer coding themes to pages even though pages are easier in some ways because you have to spend more time organizing your code and writing instructions and I hate doing that.

    plus I think it really depends on your tolerance levels for change. honestly, the npf photosets aren’t too bothersome unless you post lots of photosets or really don’t like it when margins are 5px out of place, and as someone who falls into the latter camp, that’s why it bugs me. but if you don’t care so much about that, you could just focus on learning the variables and leaving aside npf for now, since there’s not really much that can be done until Tumblr finalizes their changes.

  • link copied
    answer post by
    Anonymous sent a message

    Hi! I was wondering if you could teach me how to customize the text that appears when you hover over the title or a link?? Does that make sense???

  • seyche replied

    yes, they’re called tooltips! there’s lots of ways, but I think most thememakers use an external plugin like style-my-tooltips or tippy.js (I personally use tippy.js). the plugins have instruction on usage but there’s also this tutorial on tippy.js by silbrigthemes you can follow. 

    you can also do it with jquery ui, but as I’ve never used that method, I don’t know exactly how to do it with that method.

  • link copied
    answer post by
    Anonymous sent a message

    Hello, thank you for your time and all you do! I was just wondering if you knew of a potential code of how to fix images that are posted in text posts and distort on a theme post in a blockquote ( i.e. would like the photo to automatically size to the proper post size and won't reduce )

  • Original post
    link copied
    answer post by
    Anonymous sent a message

    Hi there! I know you're busy and I understand that answering all these questions always takes awhile which is fine... so I hope you can answer my question too. I'm using the day/night toggle code from egg design (which is amazing) but I noticed that on your theme for example if dark mode is turned on then it'll stay turned on even when I go to other pages on your blog... with the code from egg design I always have to manually click the button again... Could you maybe explain how you kept it on?

  • seyche replied

    I got it by following css-trick’s guide to dark/light mode and using the localStorage method. I think the css is basically the same as in egg’s guide, it’s just that the jquery uses localStorage to remember the user’s preferences, so I think you could probably just swap out the jquery from egg’s tutorial with what I have. this is my jquery:

    const btn = document.querySelector(“.night-button”);

       const currentTheme = localStorage.getItem(“theme”);
       if (currentTheme == “dark”) {
         document.body.classList.add(“night-mode”);
       }

       btn.addEventListener(“click”, function () {
         document.body.classList.toggle(“night-mode”);

         let theme = “light”;
         if (document.body.classList.contains(“night-mode”)) {
           theme = “dark”;
         }
         localStorage.setItem(“theme”, theme);
       });

    but yes I fully recommend reading through the guide since I’m a novice with jquery and I can’t really explain it well. 

  • link copied
    answer post by
    Anonymous sent a message

    Hello! hope you're having a great day. I just wanted to ask (i use the theme cherry blossom) if it's possible to use custom fonts from external sites on themes? like from sites like dafont and stuff. i have a font i really want to use, but any tutorial i follow just doesn't work. if it's not possible, that's fine! your theme is magnificent and the code is so well written and easy to go through! thank u in advance for ur reply!

  • seyche replied

    thank you! yes, it’s possible to do so by using the @ font-face property, and I see themes that use it fairly regularly. if it’s not working, I’d guess it’s something to do with a font hosting problem - although I probably shouldn’t speculate because I’ve never tried it before.

  • Original post
    link copied
    answer post by
    Anonymous sent a message

    Hello Naomi! I hope it is okay to ask but first of all: EVERYTHING YOU PUBLISH (FOR FREE) IS SO GORGEOUS AND BEAUTIFUL. I use your themes and pages for all my blogs. Secondly, I was wondering if you know how you can change the tumblr control icon (for example to have it be three dots or three lines and then you hover over it and see the follow, message, etc. icons)? :)

  • seyche replied

    thanks! and yeah I answered really quickly this a few months ago in brief but people keep asking so I might as well go into more depth since it’s not complicated.

    choose an icon and put it in the HTML above </body>, like so (this is an svg from feathericons, but anything works):

    <div id=“controls-icon”>
       <svg xmlns=“https://www.w3.org/2000/svg” width=“48” height=“48” viewBox=“0 0 24 24” fill=“none” stroke=“currentColor” stroke-width=“2” stroke-linecap=“round” stroke-linejoin=“round” class=“feather feather-settings”><circle cx=“12” cy=“12” r=“3”></circle><path d=“M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z”></path></svg>
    </div>

    then, in the CSS above </style>, you have to fix it in the top right-hand corner with something like this, plus whatever styling you want for the button:

    #controls-icon svg {
       position: fixed;
       top: 20px;
       width: 1.5em;
       height: 1.5em;
       right: 20px;
       z-index: 50;
    }

    and finally, you need to add padding to the native tumblr controls so that the padding overlaps the icon you put in the right-hand corner. you also have to set the opacity to 0 so that when the user hovers over the icon, the opacity of the controls changes to 1, like so:

    .tmblr-iframe-compact .tmblr-iframe–unified-controls {
       z-index: 999999999!important;
       opacity: 0;
       margin-top: 0.65em;
       padding-right: calc(35px + 1.5em);
       -webkit-transition: all 0.5s;
       -moz-transition: all 0.5s;
       -ms-transition: all 0.5s;
       -o-transition: all 0.5s;
       transition: all 0.5s;
    }
    .tmblr-iframe-compact .tmblr-iframe–unified-controls:hover {
       opacity: 1.0;
       -webkit-transition: all 0.5s;
       -moz-transition: all 0.5s;
       -ms-transition: all 0.5s;
       -o-transition: all 0.5s;
       transition: all 0.5s;

    }

  • link copied
    answer post by
    Anonymous sent a message

    hello i have a little question if thats okay. i make themes for myself and ive just started trying to make them responsive. But i have a problem: when I add padding to my posts it makes it bigger than what i set it as. this didn't happen before i started adding the viewport & chartset meta tags etc. I tried seeing if it was the margins and alternating between px and em units, but it still happens, so i really dont know whats causing it or how to fix it

  • seyche replied

    it sounds like you need to add box-sizing: border-box; to your selectors. I could be off-base though since I suck at doing coding without a lot of trial and error.

  • link copied
    answer post by
    Anonymous sent a message

    I just wanted to ask if you have any suggestions on where to learn to use svgs? I've been trying to add some extra icons to cherry blossom and the svg codes i'm pasting aren't big like the ones you've put into the theme. I've tried looking on other sites, and the codes still don't match the size. I'm opening it as a text file but the size of the code still doesn't match yours or the sites i've checked. (1/2)

  • seyche replied

    I see this ask has a (½) at the end but I didn’t get a second ask so if you sent one, Tumblr must have eaten it. resend if you want to.

    here’s a list of explainers:

    you can resize the svgs with CSS. cherry blossom already has a lot of pre-existing CSS that styles the svgs, so your svgs might be being affected by that; you can check what styles are being applied with your browser’s inspect element tool.

  • link copied
    answer post by
    Anonymous sent a message

    hi, i was just wondering how you got the tumblr controls to only appear after hovering over an icon, like in some of your themes? i've searched everywhere for a tutorial but the closest i got was a code by cyantists, ofc they're deactivated now so the code is inaccessible :(

  • seyche replied

    yeah, that was the one I used too back when I first coded the controls like that. the basic idea is to put your icon wherever you want, and then position the controls nearby but give the controls selector enough padding so that the controls padding overlaps the icon, but the controls themselves don’t overlap the icon. then give the controls selector opacity: 0;, and set a :hover on the controls so that when the user hovers over the controls, the opacity changes to 1. 

    you could take a look at my rosemary theme to see how I did it, but there’s no one-size-fits-all kind of code with this, since you’ll have the adjust the code depending on how big your icon is, where you position your controls and icon, and how much padding you want.

  • link copied
    01. 02.
    page 1 of 2
    next