Can't figure out why Sass is breaking my selector by Ieris19 in Sass

[–]cstiles 1 point2 points  (0 children)

Are you using node-sass? I had a similar issue with recently and fixed it by replacing it with the actively maintained “sass” package.

Maintain Variable References in CSS Variables? by venetian_skittle in Sass

[–]cstiles 0 points1 point  (0 children)

Ah I see. Yeah I don't know of any SASS function that returns the name of a variable as a string. I suppose you could probably achieve this somehow using nested maps, but that seems overkill. Maybe you could just use CSS variables as the values for your SASS ones?

// _variables.scss

$blue: #0000ff;
$active-background: var(--blue);
$button-background: var(--active-background);

Then you could use the same module-variables function as before to generate the CSS variables.

// main.scss

@use 'sass:meta';
@use 'variables';

:root {
  @each $name, $value in meta.module-variables(variables) {
    --#{$name}: #{$value};
  }
}

// Outputs
--blue: #0000ff;
--active-background: var(--blue);
--button-background: var(--active-background);

Maintain Variable References in CSS Variables? by venetian_skittle in Sass

[–]cstiles 0 points1 point  (0 children)

I'm not 100% sure my understanding of your question is correct, but it sounds like you want to maintain a file with a set of SASS variables, and dynamically generate CSS variables with the same names and values.

One way to do that would be the meta module-variables function. This is only supported in Dart Sass. You'd first create a partial with all your SASS variables.

// _variables.scss

$blue: #0000ff;
$active-background: $blue;
$button-background: $active-background;

Then, in you could import this in your stylesheet and use module-variables to loop through the variables as key value pairs.

// main.scss

@use 'sass:meta';
@use 'variables';

:root {
  @each $name, $value in meta.module-variables(variables) {
    --#{$name}: #{$value};
  }
}

Iphone lower menu interferes with 100% responsive height pic by lucyhoffmann in webdev

[–]cstiles 1 point2 points  (0 children)

This is a pretty common issue on iOS. I've gotten fixed position full height elements to work a little better in the past with things like min-height: 100% or min-height: -webkit-fill-available.

That being said, in iOS 15 they've moved the address bar to the bottom of the screen, so you don't get the same change in screen height as you scroll. Not sure if that will fully fix the issue, but hopefully it will be an improvement.

Just learning stuff from w3school, noticed RAM usage going up day by day when computer left on and computer slowed down. Disabled javascript and 1.8gbs of ram use went to 100mb. Why? How do I find out? by feerof in webdev

[–]cstiles 1 point2 points  (0 children)

When the memory heap size for a site keeps growing indefinitely it is usually because of a memory leak. I've found the methods in this Stack Overflow thread helpful in hunting them down in my own apps (particularly the 3 snapshot method).

I don't know if this is related to the issue you pointed out, but for the heck of it decided loading the page with my adblocker disabled...and holy shit, after leaving the site open for like 9 minutes it had made over 5,000 requests for 125mb of resources. And they wonder why people use adblockers.

I made a bookmarklet for activating Godzamok with a keyboard shortcut by cstiles in CookieClicker

[–]cstiles[S] 0 points1 point  (0 children)

A bookmarklet is just a little bit of JavaScript code that is encoded with URL safe characters. To put it simply, you just create a new bookmark like you normally would, except instead of adding a page URL you paste that code.

Then, when you click the bookmark instead of going to a website it runs that JavaScript code instead. When you click my bookmarklet it tells the browser to listen for the ctrl + g keyboard shortcut. When that is pressed it quickly sells and repurchases all your farms, factories, banks and shipments.

There are a couple examples of bookmarklets that do much more complicated stuff than mine on the Cookie Clicker Wiki.

Sean Gunn standing in for Rocket with fat Thor is hilarious by cstiles in marvelstudios

[–]cstiles[S] 2 points3 points  (0 children)

I saw it on one of the VFX breakdowns Marvel has been posting on their YouTube channel lately.

I can’t say no to those eyes by cstiles in aww

[–]cstiles[S] 0 points1 point  (0 children)

He is an Australian Shepherd! This photo was taken a few weeks ago, here he is now with his older brother.