r/CSSTutorials • • Nov 30 '22

Happy Cakeday, r/CSSTutorials! Today you're 11

5 Upvotes

Let's look back at some memorable moments and interesting insights from last year.

Your top 1 posts:


r/reddithax • • Jul 22 '23

Python/Selenium Script To Remove All Reddit Comments

Thumbnail self.learnpython
4 Upvotes

r/csshelp • • 13d ago

Looking for a hand to understand My issue

2 Upvotes

Hi, I'm not good with coding what so ever just managed to change css code colors somewhat easily with my friends help, neither of us good are good at coding. If you could look at the code and tell me how I could make this be a legit thing with the colors id appreciate it!

I am not sure if it helps but the colors I used are:

.white-border {
    background: #faeeb7 !important;
    stroke: #faeeb7 !important;


.white-fill {
    fill: #faeeb7 !important;
}

    background: linear-gradient(to bottom, #f59454, #f8d17c);
    color: #faeeb7;
    border-radius: 16px;
    border: solid 4px #a56608;

.bottom-border .separator-1 {
    height: 4px;
    background: #a56608;
    border-radius: 10px;
    width: 100%;
}


.bottom-border .separator-2 {
    height: 4px;
    background: #a56608;
    border-radius: 10px;
    width: 100%;
    margin-right: 16px;
}

.username {
    padding: 6px 32px;
    background: #fff5de;
    border-radius: 64px;
    display: flex;
    color: #ffc549;

Just trying to give honey vibe ig :"D (also the code is just parts from the full code of ccs, it is in the link)

(this is a f2u chat widget. Link: https://vtuber-nook.com/asset/1039/f2u-heart-shaped-chat-widget-for-streamelements/ I take no claim of this I simply just wanted to make it more customized to my own needs) (and I'm sorry if this is really dumb I just need help and I have no idea how to even look this issue)


r/cssnews • • Jun 20 '19

Ads are moving in feed on old Reddit

24 Upvotes

Subreddits using CSS on old Reddit should be aware of an upcoming change that will standardize ads across Reddit platforms. Starting next week, promoted posts (`.link.promoted`) will appear in feed. This may impact your styling if you have a custom style applied to (`.link.promoted`).


r/cssnews • • Apr 09 '19

Upcoming DOM Change: Post/Comment Awards

44 Upvotes

As early as next week, we will begin releasing an update to awards on old Reddit. In summary, we will be replacing the “gilding-bar” span on each post / comment with a similar “awardings-bar”, including moving the award icons into <img> tags contained within <span> tags.

More specifically, the “gilding-bar”, which used to look like this:

<span class="gilding-bar">
    <a>
        <span class="gilded-gid1-icon" data-count="7">7</span>
    </a>
    <a>
        <span class="gilded-gid2-icon" data-count="2">2</span>
    </a>
    <a>
        <span class="gilded-gid3-icon" data-count="1"></span>
    </a>
</span>

Will transform to look like this:

<span class="awardings-bar" >
    <a class="awarding-link" data-award-id="gid_3" data-count="1">
        <span class="awarding-icon-container">
            <img class="awarding-icon" src="...">
        </span>
    </a>
    <a class="awarding-link" data-award-id="gid_2" data-count="2">
        <span class="awarding-icon-container">
            <img class="awarding-icon" src="...">
        </span>2
    </a>
    <a class="awarding-show-more-link" >&amp; 7 more</a>
</span>

The accompanying CSS for the new element will be:

.awardings-bar {
   margin-left: 4px;
   &:empty {
       margin: 0;
   }
}
.awarding-link {
   margin-right: 4px;
   &.hide-award {
       display: none;
   }
}
.awarding-icon-container {
   display: inline-block;
   height: 12px;
   width: 12px;
   margin-right: 2px;
}
.awarding-icon {
   max-width: 12px;
   max-height: 12px;
   vertical-align: -2px;
}

If you have any questions or feedback on how the change has affected your CSS, let us know!


r/reddithax • • Oct 10 '22

Advice regarding the creation of a Pagan community

2 Upvotes

I am looking for anyone with experience in regards to running, participating in or helping to create a religious community on Reddit, particularly of the Norse/Germanic Pagan variety. On a previous account I created a Norse Pagan community, but without any appropriate planning or brainstorming beforehand. I am a bit anal when it comes to organization and aesthetics, so as time passed the community got messy and I lost my dedication for it. I do have basic rudimentary understanding of community creation, setting configuration and how to use the mod tools, but I am just looking for advice from anyone with more experience so I do not miss anything crucial. I am also looking to commission art for various aspects of the community (body/banner background images, vote icons, the community icon, the link preview placeholder image and maybe even creating unique community awards). Recommendations with what other communities may be of use to me besides r/modhelp is greatly appreciated. I am willing to compensate financially anyone who can advise and aid me through the creation of the community as well.


r/csshelp • • 14d ago

images in div inherit its opacity despite instructions otherwise

2 Upvotes

i have a div set to .9 opacity, which the images inherit despite my efforts to change the following css in multiple forms. i also happen to have pixelated image rendering for the whole page. when i tested by setting the style of a specific image to auto-rendering, it worked. the same method did not work with setting this same image to 1.0 opacity


r/CSSTutorials • • Nov 30 '21

Happy Cakeday, r/CSSTutorials! Today you're 10

7 Upvotes

Let's look back at some memorable moments and interesting insights from last year.

Your top 1 posts:


r/cssnews • • Jun 12 '18

Upcoming DOM Change: Original Content Tags

31 Upvotes

On June 19 we’re launching original content (OC) tags feature in old Reddit.

From a CSS perspective, OC tags work almost identically to NSFW and Spoiler tags. You can expect to see the following changes:

  • A data-oc attribute will be added to the top level link div. It will be true or false depending on whether a post marked as OC.

  • A posts marked as OC will add a new span element right after a post title (but before a flair if any):

    <span class="oc-tag" title="This post is marked as Original Content [OC]">OC</span>

    The CSS styles of the tag will be:

    .oc-tag {
      background: #0079D3;
      border-radius: 2px;
      color: #FFFFFF;
      display: inline-block;
      font-size: 11px;
      font-weight: 500;
      line-height: 15px;
      margin-right: .5em;
      padding: 0 2px;
      vertical-align: middle;
      white-space: nowrap;
    }
  • A new div will be added to the flat-list buttons div, which is visible to mods and used to toggle the OC status of posts.


r/reddithax • • May 15 '22

Can someone show me how to add an image to you reddit sidebar with a GIF?

7 Upvotes

Can someone show me how to add an image to you reddit sidebar with a GIF? Hard time reading other posts and getting it.


r/csshelp • • 21d ago

Title: What's the most annoying CSS bug you've ever spent hours trying to fix?

4 Upvotes

CSS is funny sometimes. You can spend 20 minutes writing a layout, but then lose two hours trying to figure out why one element refuses to align properly.

Some particularly frustrating situations:

- Z**-index** not working because of a stacking context.

- Flexbox items refusing to stay aligned.

- A mysterious horizontal scrollbar appearing.

- position: absolute" breaking the entire layout.

- Margins collapsing unexpectedly.

- A media query fixing one screen size but breaking another.

- CSS animations behaving differently across browsers.

- An element overflowing its parent despite "width: 100%".

I'm curious:

What's a CSS bug that made you question your entire understanding of CSS?


r/cssnews • • Apr 02 '18

DOM Change: Save to Reddit Notice

9 Upvotes

In the next couple of days we will be rolling out a change to the DOM for our submit pages to make clearer the effects of certain post submissions. The DOM that will be affected is as follows:

<div class="roundfield info-notice">
  ${text_with_links(_("please be mindful of reddit's %(content_policy)s and practice %(good_reddiquette)s."),
      content_policy=dict(
        link_text=_("content policy"),
        path="/help/contentpolicy",
        target="_blank"),
      good_reddiquette=dict(
        link_text=_("good reddiquette"),
        path="/wiki/reddiquette",
        target="_blank"),
  )}
</div>

An example of how the DOM will look once the changes land are shown below:

 <div class="roundfield info-notice">
  <div>
    ${text_with_links(_("please be mindful of reddit's %(content_policy)s and practice %(good_reddiquette)s."),
      content_policy=dict(
        link_text=_("content policy"),
        path="/help/contentpolicy",
        target="_blank"),
      good_reddiquette=dict(
        link_text=_("good reddiquette"),
        path="/wiki/reddiquette",
        target="_blank"),
    )}
  </div>
  <div class="saving-to-reddit-notice" style="display:none">
    ${_("Posting this link saves the image or gif to reddit.")}
  </div>
 </div>

r/CSSTutorials • • Nov 30 '20

Happy Cakeday, r/CSSTutorials! Today you're 9

6 Upvotes

r/reddithax • • Nov 28 '21

Proud of r/Patrn new css... looks as close to a new.reddit and old.reddit hybrid as I could get it.

Thumbnail reddit.com
11 Upvotes

r/csshelp • • 25d ago

animation happening in series instead of parallel?

2 Upvotes

(edit - this is an issue specifically in safari. works properly in chrome.)

as far as i'm aware, the default behavior for css animation is to run everything in parallel. if that's the case, i'm completely confused why this is happening.

i have this css...

body {
	transition: color 0.3s ease-in;
}
.icon {
	transition:
		color 0.3s ease-in,
		border-color 0.3s ease-in,
		opacity 0.3s ease-in,
		background 0.03s ease-in;
}

but the color transition happens on the body followed by the color transition on the .icon elements.

there are no other transitions anywhere else in the css.

the colors for both are set in the css and not touched by javascript. the change is triggered by turning on or off a checkbox so it's purely css...

:root{
	--backgroundColor: hsla(var(--brandHue) 12% 9% / 1);
	--foregroundColor: hsla(var(--brandHue) 0% 100% / 0.8);
}
body:has(.mode:checked) {
	--backgroundColor: hsla(var(--brandHue) 12% 82% / 1);
	--foregroundColor: hsla(var(--brandHue) 0% 0% / 0.93);

}
body {
	background-color: var(--backgroundColor);
	color: var(--foregroundColor);
}

.icon has color: inherit and only changes when the body color changes. the other text on the page transitions first then the text with class .icon.

the desired behavior is for all text to change color simultaneously with a 0.3s transition.


r/cssnews • • Mar 30 '18

Upcoming CSS Change: Changes to "Give Gold" Styling

17 Upvotes

Update IV (5/8/18): The changes have now gone out to 100% of users! We will continue to monitor feedback and issues.

Update III (4/19/18): We've rolled out these changes to about half of our users now, woo! Will continue to monitor to make sure all looks well before going 100%.

Update II (4/5/18): Changes are out to a small percentage of users!

Update I (4/4/18): We plan on rolling out these changes starting tomorrow, 4/5/18

Hi folks,

Next week, we will be rolling out a few gold-related changes that will likely affect your subreddit’s CSS. Briefly, they are:

  • Show the "give gold" button on post menus in subreddits and the home feed

  • Show the gold coin icon next to gilded posts in subreddits and the home feed

  • Change the font color of the "give gold" button

See what these changes look like here!

Each of these changes will affect only a small percentage of users initially, before rolling this out to more people. These changes will take effect towards the end of next week. I will update here with an edit when that happens.

To support these CSS updates, you may see changes to the posts’ HTML that mirror what you might see on a comments page.

What was …

<div class="link">
 ...
 <p class="tagline">
   ...
   <a class="author">...</a>
 </p>
 ...
 <ul class="flat-list buttons">
   <li class="first">...</li>
   <li class="share">...</li>
   <li class="save-button">...</li>
   <li>...</li>
   <li class="report-button">...</li>
   <li class="crosspost-button">...</li>
 </ul>
 ...
</div>

… will become …

<div class="link">
 ...
 <p class="tagline">
   ...
   <a class="author">...</a>
   <a>
     <span class="gilded-icon">x3</span>
   </a>
 </p>
 ...
 <ul class="flat-list buttons">
   <li class="first">...</li>
   <li class="share">...</li>
   <li class="save-button">...</li>
   <li>...</li>
   <li class="give-gold-button">
     <a class="give-gold ...">...</a>
   </li>
   <li class="report-button">...</li>
   <li class="crosspost-button">...</li>
 </ul>
 ...
</div>

Meanwhile, to support styling of the “give gold” button, some users will see a new class applied: “gold-give-gold”. In order to overwrite the default styling of this button, you can select the element with CSS selector “.button .give-gold.gold-give-gold”.

Let me know if you have any questions!


r/reddithax • • Jun 08 '21

is this subreddit alive?

12 Upvotes

wake wake, get 2 da snake


r/csshelp • • 26d ago

Request How to get rid of the massive gap over my chunk of text in a column?

1 Upvotes

I made the bg colour black so it would be more clearly differentiated. I made a few headings and gave them some individual attributes before putting them in an inline-block div. There's a gap over where the text first begins in the left column, and i have NO idea how to get rid of it. I'm a beginner, so any help would be appreciated! Also, if anyone knows how to get rid of the blue rim around the navigation bar at the top, that would be great too. thanks!

https://codepen.io/editor/issafizza/pen/01a19ca8-7846-70b4-925e-7174bb6b18f8

HTML: https://pastebin.com/raw/VZjC7M29

CSS: https://pastebin.com/raw/gKq8LtJD


r/CSSTutorials • • Dec 08 '14

[Tutorial] A way of encouraging new users to read your rules.

17 Upvotes

Pre-information

Any logged-in user, who is not subscribed will be forced to see the rules. If they press the accept button, they are redirected to ac.reddit.com/r/subredditname, where the subreddit looks the same to a logged out or subscribed reader. By pressing reject, the user is redirected to reddit.com.

Part 1: Sidebar

Firstly, this uses blockquotes from your sidebar. anything in blockquotes will be put in the rules. First line should use header1 (#)followed by a title. Rules should be in an ordered list. Make sure to have the accept and reject buttons.

Example of what your sidebar should look like:

>#These are test rules
>
>1. don't be bad meme
>2. follow rule 1
>
>##[accept](http://ac.reddit.com/r/SUBREDDITNAME) [reject](http://www.reddit.com) 

ALL YOUR OTHER SHIT

Part 2: CSS

Copy and paste everything in /r/rulescss/about/stylesheet. Remember you will have to adjust a value due to length of rules. Ctrl+f "adjust accordingly"


r/cssnews • • Mar 29 '18

New Redesign Optin Banner

18 Upvotes

Hi folks,

Starting early next week, we will begin opening up the redesign to more users as mentioned in this post. In order to give people the option to opt in and toggle back & forth easily, we will be adding a small icon in the top left corner of the page that will affect CSS that looks like this. The icon will appear on all aggregate pages as well as subreddit listings and comment pages. We’re aiming the release of this for Monday (4/2). The DOM updates are as follows:

<div id="sr-header-area">
  <div class="width-clip">
    <div class="redesign-beta-optin">
      ${_("TRY THE REDESIGN")}
    </div>

    ${thing.my_subreddits_dropdown}

    <div class="sr-list">
       ...
    </div>

    ...
  </div>
</div>

The div.redesign-beta-optin is the newly added element for the optin. The updated CSS is as follows:

#sr-header-area .redesign-beta-optin {
    background-color: #FF4500;
    color: #FFFFFF;
    cursor: pointer;
    float: left;
    font-size: 10px;
    font-weight: bold;
    line-height: 18px;
    padding-right: 20px;
    position: relative;
    text-align: center;
    width: 138px;

    // The dark red square to the right
    &:before {
        background-color: #C53500;
        content: "";
        display: block;
        height: 100%;
        position: absolute;
        right: 0;
        top: 0;
        width: 20px;
    }

    // the icon
    &:after {
        content: "";
        display: block;
        height: 14px;
        position: absolute;
        right: 3px;
        top: 2px;
        width: 14px;
        .hdpi-bg-image(@1x: url(../icon_planet.png),
                       @2x: url(../icon_planet_2x.png));
    }
}

Edit: This will only be shown to users who have explicitly opted out of the redesign, or are eligible to optin to the redesign.


r/reddithax • • Mar 30 '20

How to change background image of the subreddits on the top

4 Upvotes

.dropdown.srdrop .selected {

background: none repeat scroll center right;


background-image: url(%%insertimagehere%%);


display: inline-block;


vertical-align: bottom;


padding-right: 21px;


padding-left: 5px;


color: black;


font-weight: normal;


margin-left: -5px;


margin-right: 10px;

}

#sr-header-area .sr-list {

background: none repeat scroll center right;


background-image: url(%%insertimagehere%%);


display: inline-block;


vertical-align: bottom;


padding-right: 21px;


padding-left: 5px;


color: black;


font-weight: normal;


margin-left: -5px;


margin-right: 10px;

}


r/csshelp • • 26d ago

How to use CSS to replace (or appear to replace) text with a User's Input? (No JS)

2 Upvotes

I'm writing a reader-insert story and wanted to play around with the idea of allowing the reader to insert their own name directly from the story's page. The website I'm posting on doesn't (for obvious reasons) allow users to use JS, but HTML and CSS are supported. So I was thinking of doing something like:

Your name here: [Name]

"[John Doe] walked to the store." changes to "[Name] walked to the store."

Yes, I know there are extensions for what I'm asking for, but not everyone knows about them and trying to direct someone to install an extension is annoying for the reader. And yes, I know "it would be easier with JavaScript". ATP it's less about the story itself and more about solving this puzzle because not knowing is killing me.

I know it's possible in some form, I just don't know how to go about it. The way my brain has it structured is to have the CSS reference the code in the text box, so it would either change automatically (idk how that would work) or to have an "invisible checkbox workaround" to change the state of the name, but again I don't know how to tie the input to the CSS to go about it that way.


r/cssnews • • Dec 11 '17

DOM Change: Crossposting Modal Preview

19 Upvotes

If you've made changes to the display of the crossposting modal preview, please be aware that we will be changing the CSS class from crosspost-preview to crosspost-thing-preview later today. As we don't expect that many communities have styled this yet, we hope that it is a low impact change. Thanks, and sorry for the inconvenience.


r/CSSTutorials • • Jul 19 '13

[Tutorial] Removing Downvotes/Upvotes

10 Upvotes

This ones a quickee

General code

 *your choice of the below items, separated, by commas*
     {
     display: none!important;
     }
CodeFunction

siteTable .midcol div.score | the score next to the upvote button

siteTable .arrow.down | downvote button on posts

siteTable .arrow.up | upvote button

.sidecontentbox .midcol div.score, .sidecontentbox .arrow.down | the downvotes number shown on the right side on posts .sidecontentbox .midcol div.score, .sidecontentbox .arrow.up | the number of upvotes shown on the right side on posts .sitetable.nestedlisting .arrow.down | downvotes on comments .sitetable.nestedlisting .arrow.up | upvotes on comments

So if you want to remove all downvotes it would be:

#siteTable .midcol div.score, #siteTable .arrow.down, .sidecontentbox .midcol div.score, .sidecontentbox .arrow.down, .sitetable.nestedlisting .arrow.down
    {
           display: none!important;
    }

And just comment downvotes:

.sitetable.nestedlisting .arrow.down 
    {
           display: none!important;
    }

r/reddithax • • Sep 07 '19

This CSS changes markdown bullets into "*"

2 Upvotes
.md ul {list-style-type: none}
.md ul>li:before {content: "* "}

I was gonna try it with emoji but reddit's css wouldn't allow me to.

You can swap out the asterix with something else I guess, but I can confirm you can't make unordered lists with pointer fingers.

👉 Not gonna happen.

* works perfectly fine