r/css • • 24d ago

Question Can someone help me learn CSS for StreamElements chat boxes?

I want to make something similar to this, but I am a dumbass newbie to CSS period and I don't know how to do it. Please no suggestions to use ChatGPT, I will not use that crap, I want a HUMAN tutorial on how. Is it hard? How long will it take?

0 Upvotes

6 comments sorted by

4

u/xentraz 24d ago

Have you tried googling it? Maybe look at a css tutorial or YouTube or similar?

2

u/Zeether 24d ago

I'm trying to find a place with a similar theme widget but I can't find it

3

u/lol25potatofarm 24d ago

I don't know how StreamElements chat boxes work, but you would need to access and change the following properties on the default StreamElements chat box: ● font-family (like times new roman etc) ● color (the text color) ● background-color (self explanatory) ● border (the white border around the container)

If you shoot me a DM with a bit of info about how it works, I may be able to help.

2

u/mposha 24d ago

I don't follow your exact ask but looks like you'd need rules for:

container { display:; }

chat-box { max-width:; background-color:; border:; border-radius:; padding:; }

text { color:; font-family:; font-size:; }

Is a good starting point maybe to fill in the blanks and expand?

2

u/asteconn 23d ago

Professional web dev here, give this a go as a starter:

@keyframes fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.overlay,
.widget,
.twitch-chat,
.chat-line {
  overflow: visible !important;
}

.twitch-chat {
  perspective: 625rem;
}

.chat-line {
  --font-family: 'Courier New';
  margin: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  opacity: 0;
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  animation: fade 0.5s ease-in-out forwards;

  & .username {
    z-index: 20;
    padding-block: 0.125rem;
    padding-inline: 0.125rem;
    border-radius: 1.0rem;
    color: #ef2320fe !important;
    background: transparent;
    line-height: 1.5;
    font-size: 1.0rem;
    font-weight: 400;
    font-family: var(--font-family), monospace;
    text-shadow: 0 0 0.125rem hsl(from black h s l / 25%);
  }

  & .message {
    margin-block: 0.25rem;
    padding-block: 0.25rem;
    padding-inline: 0.25rem;
    border: 1px solid #efefeffe;
    border-radius: 0.75rem;
    color: #10bfe0fe !important;
    background: #232323fe;
    line-height: 1.5;
    font-size: 1.0rem;
    font-weight: 400;
    font-family: var(--font-family), monospace;
    text-shadow: 0 0 0.125rem hsl(from black h s l / 25%);
  }
}

.badges {
  display: inline-flex;
  gap: 0.25rem;
  align-items: flex-end;
  margin-right: 0.5rem;
}

.colon {
  /* uncomment to hide the semi-colon: */
  /* display: none; */
}

Feel free to ask if anything doesn't make sense.

-3

u/CharacterOtherwise77 23d ago

I strongly suggest using ChatGPT - it will crush this.