r/ModSupport • • 17d ago

Why does creating a link flair in old reddit looks different than new reddit ?

The first seven in that list were created in new Reddit, the last two in old Reddit. Why are they presenting differently ? Is there a default CSS that differs based on where they were created ?

[screen snapshot](/preview/pre/link-flairs-v0-ydbxbuxc1d1i1.png?auto=webp&s=9a94247f505fffc9983500a88dae8efd88e965f2) taken from link edit page in old reddit.

Desktop {old | new} macOS

edit: they also present differently in New Reddit, when trying to create a post ...

/preview/pre/flairs-via-new-reddit-v0-bn5ky5lm8d1i1.png?auto=webp&s=c118059815ae9cfcb29ddd10d52c58b24606e006

edit2: checking new Reddit, I see no sign of CSS assigned to any of them.

6 Upvotes

9 comments sorted by

4

u/cosmicrae 17d ago

I may have a partial answer, but unsure where/how to proceed: When all else fails, dig down and look at the HTML being generated. The generated HTML for new Reddit created flairs is different from the generated HTML for old Reddit created flairs.

New Reddit flair ...
<span class="bg-tone-4 inline-block truncate max-w-full text-12 font-normal align-text-bottom box-border px-[6px] rounded-5 leading-4 text-secondary border-solid border-sm border-neutral-border-weak " style="background-color: transparent;">

Old Reddit flair ...
<span class="bg-tone-4 inline-block truncate max-w-full text-12 font-normal align-text-bottom box-border px-[6px] rounded-5 leading-4 text-secondary " style="">

That says they are being stored somewhere on Reddit, with information that I (as a moderator) have no control over (I think).

Looking for thoughts/ideas where to go next.

3

u/Littux 17d ago

Here's the raw data for the flairs:

[
	{
		"allowableContent": "TEXT",
		"backgroundColor": "transparent",
		"id": "de706f8e-dd32-11f1-8f06-c20cf475ecdb",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Community ",
		"textColor": "DARK",
		"type": "text"
	},
	{
		"allowableContent": "TEXT",
		"backgroundColor": "transparent",
		"id": "a5ccd764-deb1-11f1-a65f-e22af9632d98",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Local Resources",
		"textColor": "DARK",
		"type": "text"
	},
	{
		"allowableContent": "TEXT",
		"backgroundColor": "transparent",
		"id": "decd91b0-df4d-11f1-bcb6-26f4a270b4c0",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Roads/Traffic",
		"textColor": "DARK",
		"type": "text"
	},
	{
		"allowableContent": "TEXT",
		"backgroundColor": "transparent",
		"id": "e8fd2f56-df4d-11f1-8702-26f4a270b4c0",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Development",
		"textColor": "DARK",
		"type": "text"
	},
	{
		"allowableContent": "TEXT",
		"backgroundColor": "transparent",
		"id": "f9928fb4-df4d-11f1-b524-5e06066b7797",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Local Sports",
		"textColor": "DARK",
		"type": "text"
	},
	{
		"allowableContent": "TEXT",
		"backgroundColor": "transparent",
		"id": "043ac7c4-df4e-11f1-aa02-b686dbfa92ec",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Hunting/Fishing",
		"textColor": "DARK",
		"type": "text"
	},
	{
		"allowableContent": "TEXT",
		"backgroundColor": "transparent",
		"id": "13ecb8d0-df4e-11f1-b524-5e06066b7797",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Local Government",
		"textColor": "DARK",
		"type": "text"
	},
	{
		"allowableContent": "ALL",
		"backgroundColor": null,
		"id": "e1c316fa-df4e-11f1-94d4-4693a8fbc353",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Local Politics",
		"textColor": "DARK",
		"type": "text"
	},
	{
		"allowableContent": "ALL",
		"backgroundColor": null,
		"id": "f00327dc-df4e-11f1-8488-2a64b9b34218",
		"isEditable": false,
		"isModOnly": false,
		"maxEmojis": 10,
		"richtext": null,
		"text": "Weather",
		"textColor": "DARK",
		"type": "text"
	}
]

backgroundColor is set to transparent for all the flairs except for the ones created on old reddit

1

u/cosmicrae 16d ago edited 16d ago

backgroundColor is set to transparent for all the flairs except for the ones created on old reddit

Is that something that I have control over ? (other than the obvious don't use both)

Can I adjust that backgroundColor directly ?

edit: The presentation of the flairs should be under control of the code at Reddit, and what platform/browser being targeted. So, to some extent, I would expect the presentation to vary across platforms. But flairs are flairs, without overt CSS they should be text, and the presentation should be consistent. That I'm seeing what I'm seeing says the presentation is inconsistent.

edit2: now I notice that there are two differences: backgroundColor and allowableContent.

2

u/itskdog 💡 Top 10% Helper 💡 17d ago

Double check|cm the CSS class is blank. Even if it looks empty, there could be a space or something.

1

u/cosmicrae 17d ago

So I'm looking at the last one, Weather, and using Mod Tools in new Reddit. There is an on/off toggle for CSS Class Name, which is off.

Then I looked at the first one, Community, again using Mod Tools in new Reddit. It has the same on/off toggle, which is off.

For both I momentarily flipped it on, but found nothing in the CSS Name field. I can't decide if the toggle actually toggles any CSS effect, or if it's just a guard for editing.

1

u/itskdog 💡 Top 10% Helper 💡 17d ago

What about if you try to change the CSS class on the Old Reddit settings?

1

u/cosmicrae 17d ago

Tried to change a New Reddit created flair, using the Old Reddit link screen. The samples (as viewed on the left) did not change. That same screen knows about the different styling (because the old reddit created ones have a box outline and the new reddit created ones do not†). The text for the flair seems to be stored along with something that is out of channel for my editing. At this point I have not attempted any custom CSS, merely trying to get them to be consistent.

† or rather, the more correct way of describing this, is the flairs created on new reddit have a box outline that is transparent (see my HTML dissection). The default, when transparent is not present, seems to be to show a box outline. The new reddit flairs are overriding that default.

1

u/cosmicrae 17d ago

See my other comment for additional information.

1

u/TheChrisD 16d ago

Old reddit flairs don't come with a "template". They're just raw text that happens to allow a custom CSS class to be applied.

For best cross-device compatibility and to see how most users see it, you really should only make flair in shreddit.