BlueBeka
BlueBeka
Explore posts from servers
TTCTheo's Typesafe Cult
Created by BlueBeka on 8/7/2024 in #questions
How to webpack? (in nextjs)
I did manage to figure this out eventually with a bit of trial and error. It's not the prettiest but it works:
if (!dev) {
// Find `next-swc-loader` which does the typescript transpilation.
let m_tsRuleSet: RuleSetRule | undefined = undefined;
tsUseLoop: for (const rule of config.module.rules) {
if (typeof rule !== 'object' || rule === null) {
continue;
}
if (rule.oneOf) {
for (const oneOfRule of rule.oneOf) {
if (typeof oneOfRule !== 'object' || oneOfRule === null) {
continue;
}
if (oneOfRule.use && Array.isArray(oneOfRule.use)) {
for (const use of oneOfRule.use) {
if (typeof use !== 'object' || use === null) {
continue;
}
if (use.loader === 'next-swc-loader') {
m_tsRuleSet = oneOfRule;
break tsUseLoop;
}
}
}
}
}
}

assert(m_tsRuleSet?.use !== undefined);
assert(Array.isArray(m_tsRuleSet.use));

m_tsRuleSet.use.unshift({
loader: "deassert/webpack-loader",
options: {
modules: ["chai"],
}
});
}
if (!dev) {
// Find `next-swc-loader` which does the typescript transpilation.
let m_tsRuleSet: RuleSetRule | undefined = undefined;
tsUseLoop: for (const rule of config.module.rules) {
if (typeof rule !== 'object' || rule === null) {
continue;
}
if (rule.oneOf) {
for (const oneOfRule of rule.oneOf) {
if (typeof oneOfRule !== 'object' || oneOfRule === null) {
continue;
}
if (oneOfRule.use && Array.isArray(oneOfRule.use)) {
for (const use of oneOfRule.use) {
if (typeof use !== 'object' || use === null) {
continue;
}
if (use.loader === 'next-swc-loader') {
m_tsRuleSet = oneOfRule;
break tsUseLoop;
}
}
}
}
}
}

assert(m_tsRuleSet?.use !== undefined);
assert(Array.isArray(m_tsRuleSet.use));

m_tsRuleSet.use.unshift({
loader: "deassert/webpack-loader",
options: {
modules: ["chai"],
}
});
}
4 replies
TTCTheo's Typesafe Cult
Created by BlueBeka on 8/7/2024 in #questions
Tailwind alias/rename utility?
For that particular one, I guess that could work. But I also have things like text-success and bg-success that would have name clashes if I try and make them both top-level
4 replies
TTCTheo's Typesafe Cult
Created by BlueBeka on 8/7/2024 in #questions
How to webpack? (in nextjs)
The tool for reference if it's relavent: https://github.com/RebeccaStevens/deassert
4 replies
KPCKevin Powell - Community
Created by BlueBeka on 2/10/2024 in #front-end
Is using `aria-labelledby` redundant on an `input` element if already has an associated `label`?
Thankls 🙂
3 replies
KPCKevin Powell - Community
Created by BlueBeka on 12/10/2023 in #front-end
Can `@supports` be used to detect support for an at rule?
@supports (transition-behavior: allow-discrete)
@supports (transition-behavior: allow-discrete)
Should do for me. Still don't know if it's possible to directly detect @starting-style
2 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/30/2023 in #front-end
css `color-mix` not working with paint api.
I can't think of anywork around to get this to work. I don't really want to have to swap out my color-mixes for static colors.
6 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/30/2023 in #front-end
css `color-mix` not working with paint api.
From inside the paint function, a custom property with a color-mix value seem to have an unset value. i.e. properties.get("--squiggly-line-color") gives CSSUnparsedValue {length: 0}
6 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/30/2023 in #front-end
css `color-mix` not working with paint api.
Trying to use it directly in the paint function results in: The value provided ('color-mix(in oklab, white 75%, black)') could not be parsed as a color.
6 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/20/2023 in #front-end
Tabindex for Button inside Link
Got it working. I made a new my-btn-link component. This component has no styling of it's own, it just uses the same class that my-btn uses to get the styles. Only down side is that there is a little bit off duplicate code to define the internals of the two components, but it's pretty small so I guess that's ok.
29 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/20/2023 in #front-end
Tabindex for Button inside Link
oki 😛
29 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/20/2023 in #front-end
Tabindex for Button inside Link
what about styling the a with display: contents
29 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/20/2023 in #front-end
Tabindex for Button inside Link
I thought about just doing that, the issue is though the button component has children elements (to do icons and that) so it's more than just styling
29 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/20/2023 in #front-end
Tabindex for Button inside Link
yeah
29 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/20/2023 in #front-end
Tabindex for Button inside Link
and it would be the link itself when needed
29 replies
KPCKevin Powell - Community
Created by BlueBeka on 10/20/2023 in #front-end
Tabindex for Button inside Link
So I'm using vue, the button is really a custom component where the root element is a button. The link is also a component, but it comes from a library. The button component is designed to just make a thing look like a button. Would it be best to change this component to conditionally only use button when it is a button rather than a link?
29 replies
KPCKevin Powell - Community
Created by BlueBeka on 6/23/2023 in #front-end
Container Query units - vertical unit all evaluate to zero
that makes sense. The min-height is actually being set by my framework but it really acts as height as there is no way for it to get bigger that that value (it has it's own scroll context to handle overflow). Hopefully I can figure out an easy way to make the framework set an actual height.
4 replies