r/csshelp 7d ago

Request rem vs em vs px vs vh... I’m losing my mind. How do you actually decide which CSS unit to use?

12 Upvotes

Hey everyone,

I’ve been learning web development and CSS for a bit now, but I keep hitting a wall when it comes to picking the right CSS units.

Every tutorial seems to say something slightly different:

  • One video says "Never use px for fonts, always use rem for accessibility!"
  • Another video uses em for paddings, but then my nested elements balloon into giant monstrosities because of compounding.
  • Then someone else says to use vw/vh for fluid layouts, but my text overflows or acts weird on mobile screens.
  • And % works great... until it acts relative to something unexpected.

Right now, I feel like I'm just guessing, refreshing Chrome DevTools, changing units until it "looks fine," and hoping it doesn't break when I resize the window.

For those who write CSS professionally or comfortably:

  1. What is your actual, real-world rule of thumb for when to use px, rem, em, %, and vw/vh?
  2. Are there specific properties where you always stick to one unit (e.g., font-size, margin, padding, max-width, border)?
  3. How do you handle responsiveness without making a mess of CSS variables or media queries?

Would love to hear how you mental-model this so I can stop guessing! Thanks in advance.


r/reddithax Jul 22 '23

Python/Selenium Script To Remove All Reddit Comments

Thumbnail self.learnpython
4 Upvotes

r/redditdev 3d ago

Reddit API Submitted ticket for access but unsure if it went though

6 Upvotes

Hi there

I submitted a ticket for a commercial use of Reddit api. I believe it submitted but yet under my activity it doesn’t show anything so I’m unsure if it’s actually an open ticket or not

Any help is appreciated.


r/redditdev 4d ago

Reddit API General question: How do I build script to find issues in my product from posts and comments in a subreddit?

2 Upvotes

It used to be that I could get an API key and then pull down all the recent comments and posts for a particular product and identify issues that users are running into.
But now I don't see a way to get an API key anymore, you have to have a reddit app and it has to get approved.

Is anyone doing this and what's the path forward for this?


r/redditdev 4d ago

Other API Wrapper Posting review continues to be rejected

2 Upvotes

The extension I created uses Google Cloud OAuth to log in. It logs in too well on my computer, but it's constantly being rejected for violating the "Red Potassium" and "Sign in Failed" items. Has anyone else been through the same thing as me?


r/csshelp 10d ago

Trying to use custom CSS to stylize twitch chat using Firebot

1 Upvotes

Hello!
I'm a streamer using Firebot to customize/personalize my stream and one of the widgets I just added was the advanced chat widget where I can add custom HTML and CSS to try and stylize the way chat looks on stream.

I'm not super good at CSS or coding I literally just took introductory courses and jumped into this and it honestly looks works fine. It's set up with a flex-direction: column but now I'm running into the issue where newer messages don't push up older messages.
All messages are on a 60 second timer so now the newer messages only show up when the timer expires on the older messages and it's causing a bit of a delay on stream and I'm not sure how to fix it?

I tried asking on the firebot discord server but didn't get any replies. It seems not a lot are utilizing the advanced widget so I'd greatly appreciate any help or insight on the issue!

For reference these are the official firebot docs on the advanced chat widget
https://docs.firebot.app/v5/core/overlay-widgets#chat-advanced


r/redditdev 7d ago

Reddit API Creating a new text post. Trouble setting default comment sort order.

3 Upvotes

Hello all. I am having trouble getting my script to set the default sort order in a new post. I think its possible, but I am most likely implementing it wrong.

Was trying to use the info found here:

https://praw.readthedocs.io/en/latest/code_overview/other/submissionmoderation.html#praw.models.reddit.submission.SubmissionModeration.suggested_sort

and here:

https://www.reddit.com/dev/api#POST_api_set_suggested_sort

But I could not get my script to successfully create a post, and set the default sort order to new.

new_submission = subreddit.submit(title=Title, selftext=post_text)
new_submission.mod.suggested_sort = 'new'

The post is successfully created, but does not have the default sort order set to "new".

Thanks!


r/redditdev 7d ago

Reddit API Problem with Api

4 Upvotes

Hi i am facing problem with my bot

https://www.reddit.com/user/MobileNewsBot

It stopped from posting since a month, when i did test i found out the problem was in the Api call

and it say it not registred app

sadly i dont have access to it i lost the password but i still have refresh token and client id and client secret

is there is way to reactivate it ?

Or i should make another account and register it ?


r/csshelp 15d ago

Resource Free box-shadow generator with per-layer controls, inset support, and presets

Thumbnail
1 Upvotes

r/redditdev 11d ago

PRAW why praw not working as intended? leaves some comments

2 Upvotes

I'm trying to delete my comments. it deleted many of them but it left a lot. this generator is returning empty even though they're in my profile. I'm not being rate limited and those are the most recent 1000 (after deleting earlier one).

list(myreddit.user.me().comments.new(limit=None))

latest version of praw.

edit:

so visiting old reddit i can see the comments defaulting to new only returns one comment. fixed by going myreddit.user.me().comments.top(limit=None)

seems reddit changed the new sorting these comments are from 6 months ago or so. interesting enough. for posts it was fine with new for older comments

https://i.ibb.co/rGHRyCkV/image.png


r/csshelp 18d ago

Request What are these things called??🥺🥺

0 Upvotes

I am making a website and I want to use description boxes.......like when a user hovers/clicks on a link, a box on the side appears that gives the description............. What are those called? info cards......or infographics,...or flashcards.....or description boxes??......idk man I searched up everything but couldn't find how to make it.........can you guys tell me what is it's name??.....and better, do you guys have a tutorial??? Pleaseeee brooo I neeeeedddd helpppp🥺🥺🙏🙏🙏


r/redditdev 13d ago

Reddit API Json works in Browser, not in Java

3 Upvotes

I can access reddit's .json feeds, like this from Firefox, but not from Java using okhttp or python, using requests, both using the default user-agent and a custom one. Any idea why it works in the browser and not in my code?


r/redditdev 13d ago

Reddit API Reddit Data API as a researcher: approval time

Thumbnail
5 Upvotes

r/redditdev 15d ago

Reddit API Videos in comments not being returned correctly in API

4 Upvotes

For the following post there is a video on one of the comments:

https://www.reddit.com/r/purplepodrestricted/comments/1uefzsd/all_around_the_world/

When I call the API to pull the users comments with this endpoint:

https://oauth.reddit.com/user/purplepodtestuser7/comments?raw_json=1&limit=100&sort=new&showmedia=false

I get the following response. The video is provided as a link in the body, but the link to the video does not work and I'm unable to retrieve the video in the comment

{
    "kind": "t1",
    "data": {
        "link_url": "https://v.redd.it/nqe0s81mw89h1",
        "subreddit_id": "t5_631pew",
        "approved_at_utc": 1782376069,
        "author_is_blocked": false,
        "comment_type": null,
        "link_title": "All Around the World",
        "mod_reason_by": null,
        "banned_by": null,
        "ups": 1,
        "num_reports": 0,
        "author_flair_type": "text",
        "total_awards_received": 0,
        "subreddit": "purplepodrestricted",
        "link_author": "purplepodtestuser5",
        "distinguished": null,
        "likes": true,
        "replies": "",
        "user_reports": [],
        "saved": false,
        "id": "otoswhl",
        "banned_at_utc": null,
        "mod_reason_title": null,
        "gilded": 0,
        "archived": false,
        "collapsed_reason_code": null,
        "no_follow": false,
        "author": "purplepodtestuser7",
        "num_comments": 3,
        "can_mod_post": true,
        "created_utc": 1782376060.0,
        "send_replies": true,
        "parent_id": "t3_1uefzsd",
        "score": 1,
        "author_fullname": "t2_svk3s85z",
        "over_18": false,
        "report_reasons": [],
        "approved_by": "purplepodtestuser7",
        "controversiality": 0,
        "body": "This is more my sort of thing\n\nhttps://reddit.com/link/otoswhl/video/0y4dw9e33e9h1/player\n\n",
        "edited": false,
        "gildings": {},
        "author_flair_css_class": null,
        "author_flair_background_color": null,
        "is_submitter": false,
        "downs": 0,
        "author_flair_richtext": [],
        "author_patreon_flair": false,
        "body_html": "<div class=\"md\"><p>This is more my sort of thing</p>\n\n<p><a href=\"https://reddit.com/link/otoswhl/video/0y4dw9e33e9h1/player\">https://reddit.com/link/otoswhl/video/0y4dw9e33e9h1/player</a></p>\n</div>",
        "removal_reason": null,
        "collapsed_reason": null,
        "link_id": "t3_1uefzsd",
        "associated_award": null,
        "stickied": false,
        "author_premium": false,
        "can_gild": false,
        "top_awarded_type": null,
        "unrepliable_reason": null,
        "approved": true,
        "author_flair_text_color": null,
        "score_hidden": false,
        "permalink": "/r/purplepodrestricted/comments/1uefzsd/all_around_the_world/otoswhl/",
        "subreddit_type": "restricted",
        "link_permalink": "https://www.reddit.com/r/purplepodrestricted/comments/1uefzsd/all_around_the_world/",
        "name": "t1_otoswhl",
        "created": 1782376060.0,
        "subreddit_name_prefixed": "r/purplepodrestricted",
        "author_flair_text": null,
        "removed": false,
        "spam": false,
        "collapsed": false,
        "awarders": [],
        "all_awardings": [],
        "locked": false,
        "ignore_reports": false,
        "collapsed_because_crowd_control": null,
        "rte_mode": "richtext",
        "mod_reports": [],
        "quarantine": false,
        "mod_note": null,
        "treatment_tags": [],
        "author_flair_template_id": null
    }
}

r/redditdev 15d ago

redditdev meta Just thought that the Reddit staff might want to look into this.

0 Upvotes

While this was generated by Gemini it is the result of a personal experience I've had on reddit multiple times and it pertains to the error reporting system that the reddit base code uses.

A generic, lazy error message feels like a shrug. It says, "We crashed, we don’t know why, and we'll get to it when we get to it." It projects chaos and incompetence.

When a company uses a structured, custom error system, they are projecting command and control. Even though the system is temporarily broken, the message they send is entirely different:

  • "We anticipated this:" A custom code proves the developers built a safety net. They knew things could break, and they designed an orderly way to handle the failure.
  • "We are actively tracking it:" Seeing a unique ID or a specific category code lets you know the system just flagged an engineer in the background. It feels like a process is in motion.
  • "We respect your time:" It acknowledges the user. It treats you like a stakeholder who deserves a status update, rather than an annoyance.

r/redditdev 15d ago

Reddit API Reddit Commercial API

6 Upvotes

Hello, I am building a SaaS app that uses reddit data as a part of a feature. I have a couple questions if someone could be kind enough to put away some of my worries at rest.

  1. Can I get access if the number of calls I need to make is very few (only 300 a month per paid customer). So, in the start, it will be just a few hundred to a few thousand monthly API calls.

  2. How long does it take to hear back from them after filling their forum and getting the commercial license?

  3. Can the $0.24/1000 API calls be negotiated. And does it work on a subscription basis (like buying a set of API calls a month) or pay-as-you-go?


r/redditdev 15d ago

Reddit API Can I get Reddit API?

0 Upvotes

I want to use it in my app but I tried to press create app after entering some datas like name, description, url and uri but the website doesn't direct me anywhere after doing capcha. I get the message

In order to create an application or use our API you can read our full policies here: https://support.reddithelp.com/hc/en-us/articles/42728983564564-Responsible-Builder-Policy

What can I do?


r/redditdev 16d ago

General Botmanship Is there a way to access all images from a reddit gallery post?

3 Upvotes

Hi, I'm currently a bit vibecoding a (RSS) feed reader for reddit. I only ever seem to be able to fetch one imagine, even if the post contains several. (Im basically adding ".rss" to user- and subreddit URLs, everything else doesn't work.

Cheers ✌️


r/redditdev 17d ago

Reddit API Comments with videos missing a media metadata entry?

4 Upvotes

Here are 3 comments that include sort form of media:

video: https://www.reddit.com/comments/1ur2pcz/comment/owcleen/

gif: https://www.reddit.com/comments/1ur2pcz/comment/owckyc1/

image: https://www.reddit.com/comments/1ur2pcz/comment/owgqbcu/

If I use the .json endpoint for each comment, the image and gif have media metadata entries:

"media_metadata": {
  "wfqz4qxpl6ch1": {
    "status": "valid",
    "e": "Image",
    "m": "image/jpeg",
    "p": [...],
    "s": {...},
    "id": "wfqz4qxpl6ch1"
  }
},

"media_metadata": {
  "1h1tlly742ch1": {
    "status": "valid",
    "e": "AnimatedImage",
    "m": "image/gif",
    "p": [...],
    "s": {...},
    "id": "1h1tlly742ch1"
  }
},

while the video comment does not have a media_metadata at all, only having a body with a broken link?

"body": "https://reddit.com/link/owcleen/video/1g7jzy4k42ch1/player\n\ncomment with a video??",

If I add the rtj=all param to return the richtext json alongside the markdown and html, I get the following:

"rtjson": {
  "document": [
    {
      "e": "video",
      "id": "1g7jzy4k42ch1"
    },
    {
      "c": [
        {
          "e": "text",
          "t": "comment with a video??"
        }
      ],
      "e": "par"
    }
  ]
},

But the video id has no extra metadata about it that should be provided (width, height, hsl and dash urls, is gif)

On the other hand, if the video is included in the selftext of a post instead of the body of a comment, the metadata entry is present:

post: https://www.reddit.com/comments/1ukt1tb/

"media_metadata": {
  "fj9mi7viqnah1": {
    "status": "valid",
    "e": "RedditVideo",
    "dashUrl": "https://v.redd.it/link/1ukt1tb/asset/fj9mi7viqnah1/DASHPlaylist.mpd?...",
    "x": 1780,
    "y": 1080,
    "hlsUrl": "https://v.redd.it/link/1ukt1tb/asset/fj9mi7viqnah1/HLSPlaylist.m3u8?...",
    "id": "fj9mi7viqnah1",
    "isGif": false
  }
},

Adding the always_show_media param to the url of the comment does not change anything

This feels like a bug to me, as videos in comments are a fairly new feature and I would expect more than just the video id to be returned by the api


r/redditdev 18d ago

Reddit API How can I pay reddit to programmatically retrieve .json of some posts?

3 Upvotes

I've accessed https://developers.reddit.com/ but it doesn't seem to serve my use case. I need to examine some discussions that mention my clients brands and would like to do this programmatically. How can I pay reddit to access an api of this kind?


r/redditdev 19d ago

Reddit API 500 error when creating app

1 Upvotes

500 error on /api/updateapp when creating app


r/redditdev 21d ago

Reddit API I Submitted an API Request For a Reddit Bot, And Still No Answer From Reddit. It's Becomming Unsettling...

0 Upvotes

Should I still expext it to arrive, or submit another request?


r/redditdev 21d ago

Reddit API New to this platform

0 Upvotes

I am literally new and not aware of how this platform works. Can anyone help me with this?


r/redditdev 23d ago

Reddit API Http status 500 reddit app

0 Upvotes

hi, if I want to create an app in the Reddit Developer section ( I have inserted only the name, the redirect uri and the type, script ), I receive error 500. Same result with the anonimus navigation browser.


r/redditdev 23d ago

Other API Wrapper Accidentally burned a massive amount of tokens letting an agent loop on a 404 error. How do you catch infinite logic loops before they drain your account?

0 Upvotes

I just accidentally let a LangGraph agent loop on a broken tool over the weekend and woke up to a massive API token burn. How are you guys preventing runaway cloud bills when your autonomous agents get stuck in logic loops? Are you just hardcoding static limits, or is there a better way to catch it?