tumblr themes + resources

Screen recording of a navigation menu that slides in from the left of the screen.ALT

CSS-only Sliding Menu

base code / simple preview

Aside from some built in transitions and CSS variables, this is a blank template to build your own menu content. To showcase what you can do with it, I’ve also made a customized preview.

This is made possible with :focus-within, which lets us select a parent element based on the (focused) state of its children, similar to :has(). Using :has(:focus) could have accomplished something like this, but this selector is specialized for this purpose.

Let me know if there’s anything I should add!

image

Inset property

The inset property is a shortcut to define top, bottom, right and left position of an element.

Its value works like margin and padding so you can use it like so :

inset: 15px 30px
= top/bottom:15px; right/left: 30px
or
inset: 15px 30px 10px 40px
= top: 15px; right: 30px; bottom: 10px; left: 40px

How to change your ask box color

This idea was first mentioned by seraphymns several years ago, but they have since deleted their blog. Since it was hidden behind a read more, the tutorial is gone. 

I was able to find some pieces of what they did, so I’m going to share some variations and similar methods! Keep in mind this will also mess with the icon image, but I don’t think that takes away from the ask box function.

Black/white:

#ask_form {
    filter: grayscale(100%)!important;
}

result:

image

black:

#ask_form {
filter: invert(100%) grayscale(100%)!important;
}

result:

image

Other colors:

by using hue-rotate, you can edit the degrees here to create basically whatever color button you want. Here are some examples:

filter: hue-rotate(60deg); - turns it purple

image

hue-rotate(200deg)  - orange

image

Other methods:

You can also try mix-blend-mode for similar results. However, you will need to apply this to your container, not the ask box itself. This is trickier on regular themes, but can work well with FAQ pages or other pages where you’re making your own ask box.

mix-blend-mode: difference;

will give you this:

image

If I come up with any other examples I’ll make a part 2!

Editing your theme part 2: CSSAt the end of part one, I mentioned that it’s important to know what selectors to use when you’re trying to edit the CSS of your theme.
There are some common ones, like the background image is going to be under body...

Editing your theme part 2: CSS

At the end of part one, I mentioned that it’s important to know what selectors to use when you’re trying to edit the CSS of your theme. 

There are some common ones, like the background image is going to be under body almost all of the time, but most of the time you’re going to need something more specific. 

The best way, in my opinion, to find out exactly what to use would be inspecting the element. I recommend doing this in a new tab for your blog, otherwise things might get a bit squished with both the inspect and customize panel being on the same page.  

I’m going to use Rougir as an example again. 

Let’s say I want to make the icon a circle.  The selector for images is img, however, if I try to edit selecting only img, it’s going to edit every single image on the theme, and I don’t want that. 

So, I’m going to right click on the image and select inspect. You can also use the shortcut control/command + shift + i. This is going to pull up the inspect panel which will show you exactly where that element is in the code like this:

image

It highlights what I’m selecting and where it is in the code.

Keep reading

Editing your theme part 1: getting startedA lot of theme makers, including myself, prefer not to answer most customization asks, but I wanted to cover some ways to edit themes to hopefully make it a bit easier to understand.
Keep in mind that no...

Editing your theme part 1: getting started

A lot of theme makers, including myself, prefer not to answer most customization asks, but I wanted to cover some ways to edit themes to hopefully make it a bit easier to understand. 

Keep in mind that no matter what you’re trying to edit, a basic understanding of HTML and CSS is going to help a lot. You don’t necessarily have to know all of the basics, but try to look up what you’re trying to edit.

For example, if you want to add a background image, there’s a lot more to it than just background:url(’imageurl.png’); depending on what you want to do. This just gets a background image to display. It doesn’t make it cover the whole container or stay attached to the page as you scroll. So, it’s best to do a little research on exactly what you want to do before you jump into editing. 

Once you’ve figured out what and how you want to edit, there are a few different ways to go about this.

First you should double check if there is already an option the theme comes with. Most themes come with color and image options, so if you try to add it yourself it might not work how you want it to if there’s already options available. 

Next step is going to depend on what kind of theme you have. Adding custom CSS is really simple for theme garden themes, but can be a little more complicated if it’s a custom theme not hosted on the theme garden. 

Keep reading

3 ways to organize your CSS

It’s easy to lose track of your CSS, especially if you’re writing a lot of it. This can make it really hard to find things later on if you need to change something. I used to get really frustrated with forgetting where I put everything, so here’s 3 things I do to help organize my CSS.

Using shorthand properties not only reduces the length of your css, but it makes it easier to keep similar CSS properties together. 

For example, you could have this:

body {
font-weight: normal;
font-size: 1em;
line-height: 200%;
font-family: Helvetica;
}

or this, which reduces the four lines to only one:

body {
font: normal 1em/200% Helvetica;
}

Keep reading

CSS scrollbar tutorial

as requested, here’s quick tutorial on how to make custom scrollbars.

So, a custom scrollbar is only available in webkit browsers (Chrome, Safari, and Opera). This means that any other browser will not display the scrollbar and will just use the default.

In your css, you’ll need, you’ll need to add the pseudo-element ::webkit-scollbar.

A pseudo element is used to style parts of an element. It essentially allows you to create a new type of element that you wouldn’t be able to use normally. this is different from a pseudo class, which adds styling to a specific conditions of an element (like :hover and :nth-child).

So, for a custom scrollbar, you’ll need to include ::webkit-scrollbar to set the width of the scrollbar you’re making. You can also set the height if you want to style a horizontal scrollbar.

 Please do not make your scrollbar tiny. While it’s a common aesthetic in some themes, this makes it very hard to use. You don’t want your users struggling to navigate your theme.

Then you can use ::webkit-track . the track is the background/area that your scrollbar can go up and down.

::webkit-thumb is the part of the scrollbar you click and drag.

With ::webkit-thumb, you can add pseudo classes to it to style it whenever someone hovers over it and/or selects it.

Examples under the cut!

Keep reading

CSS Grid Tutorial In my snotgirl theme and my design portfolio, I use a grid layout but without using masonry or any other script. This is possible using CSS Grid!
This (obviously) requires some CSS knowledge, but is otherwise easy to put into your...

CSS Grid Tutorial

In my snotgirl theme and my design portfolio, I use a grid layout but without using masonry or any other script. This is possible using CSS Grid! 

This (obviously) requires some CSS knowledge, but is otherwise easy to put into your theme.

Step 1

For the container of my posts, in this case I usually use  #container, I added these lines.

column-count: 2;
column-gap: 80px;

This separates the entire container into 2 columns, and puts an 80px gap in between the columns. You can adjust these numbers as you see fit!

Step 2

For the individual posts, it’s a little trickier. When you set the column count to 2 or more, it makes the things inside it half of the width of the container. So by default, if your container width is 100%, your posts will be 50% of the screen size. 

You can change this by either putting a post width to override it, or making the margins bigger.

Once you’ve got your post size set, you can add these lines

break-inside: avoid; 
display:inline-block;

These two lines override what CSS Grid does by default to the layout.

  • without break-inside: avoid, if a post is too long, it will cut the post in half, sending the bottom half to the next column. 
  • If you have a page without enough posts to make a second column, it does the same thing to force a second column. Adding display: inline-block; stops it from forcing the second column. This leaves that page with one column until enough posts are made. 

And that’s all you need to do to have a functioning grid! This is a very basic grid, of course, so you’ll need to add your own styling to it. If you have any more  questions about it, feel free to ask me!

For more help you can also check out:

CSS-Trick’s CSS Grid guide | My other tutorials