#How do I deal with a default theme's obfuscated css?

34 messages · Page 1 of 1 (latest)

kindred jasper
#

I'm trying to style the bottom border style for Starlight tabs and from looking at inspect element, this works, but I don't want to select it with obfuscated names.

.tab:where(.astro-esqgolmp) > :where(.astro-esqgolmp)[role="tab"][aria-selected="true"] {
    border-bottom: 4px solid var(--brand-500);
}
dark plinth
#

place all base, reset, and frameworks style in to css @layer

for example:

@layer framework.starlight {
  @import "...starlight.scss";
}

layered styles has lower specify
and right all ur components not layerd.
ez override. ez reading. ez af

kindred jasper
#

im not that deep into astro yet. idk what that means. i just expected something like how this works

a[id^="tab-"] {
    color: var(--embed-title) !important;
    padding-bottom: 0.2em !important;
    background-color: var(--background-tertiary) !important;
}
dark plinth
#

it's not astro stuff. its pure css

kindred jasper
#

oh i barely know anything about css lol

#

is there a guide for that?

dark plinth
#

level up! )

kindred jasper
#

i dont understand what to do with this information

#

like first off, where does the text that comes after @layer come from?

#

@layer tab?

dark plinth
#

ok. lets try another way

#

u need got works this?

a[id^="tab-"] {
    color: var(--embed-title) !important;
    padding-bottom: 0.2em !important;
    background-color: var(--background-tertiary) !important;
}
kindred jasper
#

yes it does what i need it do do. its the consistent style no matter the state

dark plinth
#

then what's wrong?

kindred jasper
#

i now want to do this

.tab:where(.astro-esqgolmp) > :where(.astro-esqgolmp)[role="tab"][aria-selected="true"] {
    border-bottom: 4px solid var(--brand-500);
}
#

but its obfuscated classes

dark plinth
#

selector :where has zero specifity
its just way for scoping in astro

#

try

:is(.tab, #important) > [role="tab"][aria-selected="true"] {
    border-bottom: 4px solid var(--brand-500);
}
kindred jasper
#

wait im trying to understand the scss thing. i feel like im close

@tailwind base;
@tailwind components;
@tailwind utilities;

.inline-icon {
    @apply inline-block align-middle !important;
}

@layer components {
    .tab {
        > [role="tab"] {
            color: var(--embed-title) !important;
            padding-bottom: 0.2em !important;
            background-color: var(--background-tertiary) !important;
            
            &[aria-selected="true"] {
                border-bottom: 4px solid var(--brand-500) !important;
            }
        }
    }
}
dark plinth
#

did u install sass to ur project? )

kindred jasper
#

no i thought that was already built in

dark plinth
#

no. u have to install it

#

but now

#

w8 a bit

kindred jasper
#

it did tell me to do
npm install -D sass

#

so i did that

dark plinth
#
@tailwind base;
@tailwind components;
@tailwind utilities;

.inline-icon {
    @apply inline-block align-middle !important;
}

:is(.tab, #important) > [role="tab"] {
    color: var(--embed-title);
    padding-bottom: 0.2em;
    background-color: var(--background-tertiary);
}
            
:is(.tab, #important) > [role="tab"][aria-selected="true"] {
    border-bottom: 4px solid var(--brand-500);
}
#

try this. pure css

kindred jasper
#

but you said to level up. now i dont want to do pure css anymore /j

#

this whole time ive been editing this stylesheet, ive been wondering if there's a better version of css and i just realized there is, so id like to try and figure it out

dark plinth
#

ur truth)

#

so use sass with scss syntax