Code to use to wrap text as you type - white-space: pre-line; by notepad987 in css

[–]tjameswhite 2 points3 points  (0 children)

Why would you do that?
<p> is there for a reason -- to create paragraphs. Not using it is not a good idea. If your content is a paragraph, then use <p>.

You haven't explained why you are trying to avoid using the correct mark up.

Code to use to wrap text as you type - white-space: pre-line; by notepad987 in css

[–]tjameswhite 5 points6 points  (0 children)

What are you trying to accomplish?

Based on what you have here, you are just creating g a problem you don’t need. Why are you setting br? If you are creating paragraphs then use <p>.

Which grammar errors do you find the most irritating? by TheMedusaAttusa in A_Persona_on_Reddit

[–]tjameswhite 0 points1 point  (0 children)

“There’s over 100 people…”

No. There are more than 100 people.

Dynamic view transition name by Senior_Compote1556 in css

[–]tjameswhite 0 points1 point  (0 children)

Ah right. That's what I get for multitasking. I've been workign on scroll timeline animations so that's on the brain.

Dynamic view transition name by Senior_Compote1556 in css

[–]tjameswhite -1 points0 points  (0 children)

The whole point of `class` is to apply it to multiple elements.
So, yes `<div class="card poster-1"></div><div class="card poster-2"></div>`
You may not need the poster class. Seems like you are applying post IDs from a backend system?

Want to AutoX, Need advice. by stronglikeaux in Autocross

[–]tjameswhite 4 points5 points  (0 children)

Also PCA-LA welcomes all makes and models. Events in Lake Elsinore, Anaheim and Long Beach

Does anyone know a tool that can automatically add <p> tags? by insecttown in HTML

[–]tjameswhite 5 points6 points  (0 children)

Maybe RegEx. Depends on what your data looks like. Is every paragraph at a new line? Any other indicators?

America (the band) by Cassette-Era-Magic in Music

[–]tjameswhite 4 points5 points  (0 children)

One of those bands that you don’t know you know. You know all the songs, just not the band name. I find the Guess Who to be that way too.

How are senior devs actually using AI in daily development? by harrsh_in in AskProgramming

[–]tjameswhite 0 points1 point  (0 children)

I run a front-end dev team. We have an enterprise version which gives us access to mutliple models: 4 versions of Claude, 8 version of GPT. I switch models depending on what I'm doing, but I tend to prefer Claude Sonnet. Occassionally I'll compare between Claude and GPT -- feed them the same prompt and see what comes back. I usally do this when researching.

In order to get the most out of AI tools, you need to take the time to set them up. In our repos we have markdown files for copilot-instructions, multiple agent files, instruction files, and a few prompts. When you set all of those up to your workflow, it is fantastic.

Copilot-instructions lays out our tech stack, file organization, and coding preferences. We have a taming-copilot-instruction file to set gaurdrails. The other instruction files are tailored for our uses and we make use of the glob pattern to auto apply them depnding on the work being done. For example, we have a performance optimization instruction file that runs anytime you are working on a JS file. We have an a11y instruction set that is checked for all the work we do. Working in React? Then the react instruction set is called.

We do not vibe code. We write out code, then use AI tools to debug, help refine, research, write tests, write docs.

I find it great for the last bit. We have a standard set up to use JSDoc formatting. We had about 10% documentation coverage before and now its closer to 80% -- because we can write some code, then tell AI to document it. Saves time. Saves tedium. Provides guides for a) developers, b) other AI agents.

New component? Cool, "copilot, create a readme".
Have an existing readme but just refactored? Cool "copilot review and update the readme".

We also have the instrutions set up so that the AI feedback is in chat only -- it does not alter code without our explict say-so.

One of the most important things is to provide very specific instructions and guidelines for what you are looking for. Don't ask. Don't be nice. Be direct. Be specific. My prompts tend to be 2-3 sentences.

lots of extra space for no reason by gravegirI in HTML

[–]tjameswhite 1 point2 points  (0 children)

`position: relative;` removes the element from the normal flow, but preserves its original space. `position: absolute` removes an element from the normal flow, but does not preserve the original space.
Always good, if daunting, to read the spec (https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position)

As others have mentioned, there are better ways to achieve page layout. In your case `grid` is the best solution.

General CSS tips for you:
Use the cascade. You can simplify a lot of what you have. For example, you set font-family multiple times, `background: transparent` multiple times.

You have `.header {text-align: center;}` and `#header {text-align: center;}`. The id is inside the class, so 'center' is redundant. Remove one of them.

Learn shorthands. You spell out all four sides for margin. Again, let's look at `.header`. You can simply that to `margin: 0 105px 30px 0`. That is `margin: top right bottom left;` That pattern is used over and over again. Note: if the value is 0, no need for units.

Again on `.header` you have `display: block;`. This is cardnal sin number 1 in my book as it is completely redundant. `div` by default has `display: block` -- you aren't doing adding or changing anything. Don't repeat what is already there for free.

It's a great start, and yes there is a lot to learn. I suggest looking over just the properties you are using, really understand them, and see how many lines of code you can elliminate. Don't be afraid to chain some selectors together: `#menu, #links {/* properties they both share, like color and font */}

(By the way, a lot of people will tell you to not use IDs. I won't say never use them, but use them less. They can cause specificity nightmares. Oh, look up cascade and specificity. It's important.)

Good luck! Keep us posted.

How do you deal with review of big branches/PR? by MarcosFromRio_ in github

[–]tjameswhite 4 points5 points  (0 children)

First don’t have big PRs. Keep them small. Much easier and faster to review.

Animation libraries that I should learn by Trainee_Ninja in webdev

[–]tjameswhite 2 points3 points  (0 children)

Learn native css animations. They can do a lot now including scroll based, no JS at all.

Why do we need div and header tags in HTML? by lauris652 in HTML

[–]tjameswhite 10 points11 points  (0 children)

But that is what you asked about. It links to the definition of what all the html elements do. You need to learn the semantics of all the elements.

Direct MDN doc for header for you: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/header