DEV Community

Cover image for 5 Things AI Can't Do, Even in Sass/Scss
DevUnionX
DevUnionX

Posted on

5 Things AI Can't Do, Even in Sass/Scss

While AI tools accelerate web development processes these days, they still encounter various limits in stylesheets, particularly in the SCSS/SASS context. SCSS/SASS, as a preprocessor language extending CSS, offers features like variables, mixins, nesting, and functions. These features make creating organized and dynamic style structures easier for human developers, but AI models generally cannot fully leverage these advantages. What follows examines five areas where AI falls short even in SCSS/SASS. Each section addresses why AI struggles, the topic's technical details, and example scenarios.

Every rule in CSS/SCSS files produces different results depending on where it appears and other existing styles. A nested selector like .header .logo, for instance, affects only the .logo tag found inside .header. This structure creates contextual dependency: a rule's appearance in the browser can be understood only by considering it together with page hierarchy and other styles, not just that style line alone. Take a position: relative declaration. If this declaration applies to a different parent, the element's positioning changes completely. Even experienced developers sometimes must use trial and error with different position, z-index, Flexbox/Grid layouts, and units like percentage/em/rem to find the right combination. AI models are content just seeing the SCSS code generated; they cannot fully grasp in what context that style gets used or the HTML structure. Examining a single line of SCSS code in isolation is like reading only subtitles trying to understand the whole movie.

Consider a project using this nested structure in SCSS files:

.card {
  display: flex;
  .button {
    margin-top: 10px;
  }
}
Enter fullscreen mode Exit fullscreen mode

Here the .button class is defined inside .card. Even if AI only sees the code .button { margin-top: 10px; }, it cannot know whether this rule's effect occurs inside .card. So when we use the .button element elsewhere, will this margin apply or not? AI alone cannot resolve such uncertainties. Actual browser output gets determined by combining style rules through cascade and specificity, and this is a combination problem. Complex selectors like &:hover in SCSS, nested styles inside @media queries, or complicated @extend usage all factor in. All these complexities make understanding styles by looking only at the code impossible. Therefore, AI cannot predict what a rule will do without seeing all style files and page structure. While even human developers might not fully understand this contextual complexity, it remains an obstacle for AI.

Example scenario: An AI generates style code from a form saying the header menu should be horizontal, hamburger menu on mobile. But without knowing the exact HTML structure and other rules, it might confuse the .header .nav selector with .footer .nav or incorrectly position the flex/grid layout. In real life, .nav under .header might conflict with other rules; AI cannot see this.

CSS/SCSS class and variable names don't by themselves indicate a function. Whether the .btn-primary class background color should be red or blue depends entirely on designer decision. Similarly, a variable defined as $primary-color in SCSS gets determined by the project's brand guidelines; AI has no access to or knowledge of these guidelines. In other words, CSS/SCSS contains no semantic content. While meaning exists in the context of tags like header or article, class names like .header or .hero carry no inherent meaning. AI sees only formatting information independent of class names or variable names; it cannot add commentary to code. AI cannot know that an error class should be red or a warning class should be yellow in a project. This uncertainty makes predicting AI style choices difficult.

The situation doesn't differ for SCSS specifically. SCSS variables get defined with $, but these variables convert to their constant values during compilation. So SCSS variable names don't reach the browser; the browser only sees result values. Therefore, when AI looks at compiled CSS code, it sees no SCSS variables there, only values. When we write $primary-color: #3498db; in SCSS, color: #3498db; outputs to the browser. AI cannot infer brand color from the word primary; it only says this is color #3498db. This doesn't eliminate the semantic gap. Similar problems exist with mixins: AI cannot understand what behavior a mixin named @mixin responsive-grid($cols) actually adds. Mixins let us define versatile styles with parameters, but AI cannot know what each parameter means. For instance, it has no knowledge whether the responsive-grid(4) call above creates a four-column grid or sets up a different layout.

As emphasized in related studies, AI only receives style information and cannot grasp context like usage purpose or brand identity. In real-world projects, a company's corporate colors, font preferences, or user demographic are integral parts of design. AI cannot learn what color a button-primary class should be because it has no pattern for this. In summary, without any semantic information integrated into CSS/SCSS code, AI cannot derive correct meaning from style names.

Example scenario: A developer defined a variable like $alert-bg-color: #ff4d4d; in SCSS. AI cannot know whether this variable represents an error message or a general emphasis color; it only sees it as a color code. Similarly, a mixin named @mixin card($shadowDepth) was defined. AI gets no clue about whether to use this mixin or how to set the $shadowDepth parameter. In short, because variable and mixin names mean less to AI than to humans, AI cannot predict developer intent.

AI systems excel at recognizing patterns learned from large datasets, but they cannot produce genuinely original designs or creative aesthetic decisions. Human designers work with experience, cultural knowledge, and intuition to produce new solutions and add emotional interactions. AI only offers a combination of patterns it saw during training. Consequently, designs AI produces typically become average, safe, and neutral results. Real data observations have shown this: AI outputs mostly consist of basic color accents, flat backgrounds, and common design templates. It doesn't go to extremes in color combinations, doesn't select striking typographic layouts. So AI leaves out emotional nuance and innovation in design.

This situation also applies specifically to SCSS/SASS. SCSS gives us themes like light/dark mode, color functions like lighten() and darken(), characteristic shadows, animation mixins, and more. These tools provide human designers great flexibility. But AI lacks the creativity necessary to use these tools optimally. When designing a healthcare site, for instance, a human designer knows blue's calming effect and makes the design blue tones. AI might use the most common palette it encountered most in similar sites in training data; it might not extract the psychology specific to healthcare sites. Even if your brand wants a vibrant, energetic tone, AI typically suggests a softer, more general theme.
Observations on this topic show that AI-generated interfaces remain emotionally software-like. AI avoids sharp color contrasts or unconventional font choices; most often it delivers extremely minimal and wireframe-like results. A simple command like create a mobile-friendly header and text area typically comes with Helvetica-like plain fonts and flat colors in gray tones; detailed palettes, visual focus points, or style enrichments are nearly absent. Because AI relies on common patterns in training data, striking or contrarian design choices rarely emerge. The resulting design is typically soulless and generic.
Example scenario: A company's logo and corporate identity contain bright orange and energetic blue. A human designer, aware of this, selects appropriate contrasts. But AI, relying only on general training data, might produce a pastel or neutral theme. While a designer can think more differently, AI mostly prefers common colors like gray-black. Again, even if AI suggests an animation mixin for a web component, because it cannot grasp real meanings like intensity or importance, it mostly returns safe, flat options. Producing genuinely creative visual style requires human experience and emotional awareness; AI cannot provide this.

Making style files manageable in large projects requires modular structure. SCSS/SASS offers the ability to manage files by dividing them into pieces, like the 7-1 model with 7 folders each serving different functions and 1 main file. But establishing this structure, deciding what to import and which mixin gets defined in which file, depends entirely on human intelligence. No universally accepted single correct project architecture exists; it varies by team and project. In fact, experienced developers have described designing CSS/SCSS architecture as the project's most difficult task.

AI systems typically focus on rapidly generating code in a flat SCSS file. Asking AI to organize all style code into neat modules creates uncertainty for it because no standard path exists. Which variables and mixins should be global, which should belong only to one component? Which folders should maintain consistency? A project might have sections like Abstracts for helper functions, Components for buttons and cards, Layouts for header/footer, Pages for page-specific styles. Because AI doesn't know a general rule for this distinction, it often can present everything in a single file or divide unpredictably. Moreover, a project's growth over time and expansion for different themes/languages/states might not be predictable in advance; making the right modular design requires human intuition.

According to a source summarizing this complexity, even dividing files into more manageable modules is difficult because no universally accepted best practice exists at any company or project. In other words, the tools SCSS provides, like mixins or @import commands, exist to establish good file architecture; but determining what this architecture should look like is work only human minds can do. Because AI doesn't understand project-specific needs during modular CSS design and cannot see long-term maintenance requirements, it cannot be predictive in this area.

Example scenario: Consider a large e-commerce application. The site will support both light and dark color themes, will have numerous product and category styles. A human developer creates color variables in themes/_colors.scss, general mixins in tools/_mixins.scss, separate files like _button.scss, _card.scss for each component. AI might suggest collecting this project in a single file or make inconsistent transitions between modules. It might accidentally give .product-card styling in header.scss. This later causes code confusion and conflicts. Consequently, however powerful SCSS's modular structure, properly designing this structure requires human expertise.
Modern web pages must now work on many different devices, desktop, tablet, phone, even TV, and be accessible to everyone. These requirements closely relate to style solutions: adequate color contrasts, keyboard focus indicators, proper sequencing for screen readers, and aria attributes. But AI might overlook these rules when automatically generating styles. For instance, adding a label to each input field in a form or providing a visible border when focused with the outline property can be part of code from human hands; AI might skip these details. Real research has detected WCAG violations in half of AI-generated interfaces.
In the SCSS context, multi-device support also carries great importance. We generally use @media queries inside SCSS to define different styles for different screens or set breakpoints with mixin help. But AI typically starts by default with a single desktop layout. For instance, while a horizontal menu looks good on desktop as ordered, it should transform into a hamburger menu on mobile; if no command is given for this transformation, AI might skip this step and make the menu overflowing elements. Again, adding appropriate image sizes for high pixel density Retina screens or necessary prefixes like webkit, even if done by human hand, might not appear in AI output.

Beyond this, AI models cannot know user experience requirements. They don't memorize project information like most users use Safari 14 on old iPads or WCAG AAA standard is mandatory. While this information exists in a designer's mind, AI doesn't automatically make appropriate adjustments in the resulting CSS. AI might skip contrast ratios or keyboard focus style details based only on what it saw in training data. Yet accessibility is a fundamental part of design. Details like highlighting a link with outline in focus state or exceeding contrast limit in colors have mostly been ignored by AI.

Example scenario: A site developer wrote mobile-friendly layouts using @media (max-width: 768px) { ... } queries in SCSS. But when we ask AI to make the navigation menu useful, AI provides code suitable only for desktop layout and overflow occurs on mobile. Similarly, it might skip adding focus styles like :focus { outline: 2px solid blue; }. AI cannot care about situations like I might not know which element I'm focused on during keyboard navigation. Ultimately, when pages get generated by AI, especially with automatic tools, accessibility errors and device compatibility problems can appear.

As examined above in five points in the SCSS/SASS context, while AI eases many style generation tasks, it has limits. Areas like context dependency, semantic uncertainty, creativity needs, modular architecture, and accessibility/device compatibility still make human expertise indispensable. AI models are limited only to code generation capacity and cannot fully grasp real-world conditions, brand identity, or user needs. Even SCSS's powerful features, mixins, variables, functions, cannot close AI's gap in these fundamental areas requiring human intelligence. Therefore, using AI as an assistant is possible, but the human developer must continue assuming final decisions, creativity, and responsibility. While AI is useful in speed and prototyping stages, it's not at a level to completely replace human intelligence in final design and coding processes.

Top comments (0)