L
LLLOS.ai
Career
L
◆ AI Learning · Hard rule

When adding a new feature to a file, why does the new CSS sometimes look wrong and break the existing design?

Before writing CSS for a new feature in an existing file, a developer must read that file first. The developer must use existing variables for colors, sizes, and spacing. This prevents new features from looking different from the rest of the application.

By Pawan Nayar · from the LLOS AI Learning record

The rule

Before writing CSS for a new feature in an existing file, a developer must read that file first.

The developer must use existing variables for colors, sizes, and spacing. This prevents new features from looking different from the rest of the application.

The new CSS looks wrong because the existing file was not read first. A developer might invent new colors, font sizes, or spacing. These new values do not match what the file already uses. This makes the new feature look out of place.

A developer adds a new 'wizard' component to an existing web page. The developer does not check the page's existing CSS variables. The developer chooses new colors and font sizes from imagination. The new wizard component then looks like it belongs to a different application, not the current one.

Words you'll need

Resolved from this lesson's own record — real definitions, not invented for this page.

Scalability

Growing without breaking or getting expensive

Questions people ask

More from the same record, pulled by shared topic — not written new for this page.

How should a new design's layout be created?

A new design must use the exact layout proportions of a proven design. The proven design has been refined over many hours.

How can a developer create new toolbar icons that match an existing design style using an AI model?

A developer should provide example SVG code to the AI model. This helps the AI model understand the exact visual style.

How should a developer manage content within a fixed-size card?

A card must never change its size. The content inside the card must fit the card.

How can a developer make a website look good on both mobile phones and desktop computers?

A developer can hide the hamburger menu icon on large screens. The developer can hide the regular navigation menu on small screens.

What to remember

Before writing CSS for a new feature in an existing file, a developer must read that file first. The developer must use existing variables for colors, sizes, and spacing. This prevents new features from looking different from the rest of the application.