Various CSS stuff (#14499)

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
Zack Radisic
2024-10-12 07:00:20 -07:00
committed by GitHub
parent 9ed3858e40
commit 6b8fd718c2
82 changed files with 16775 additions and 1745 deletions

View File

@@ -46,7 +46,7 @@ pub const CssModule = struct {
allocator,
"{s}",
.{source},
config.pattern.segments.items[0] == .hash,
config.pattern.segments.at(0).* == .hash,
));
}
break :hashes hashes;
@@ -90,12 +90,12 @@ pub const CssModule = struct {
composes: *const css.css_properties.css_modules.Composes,
source_index: u32,
) css.Maybe(void, css.PrinterErrorKind) {
for (selectors.v.items) |*sel| {
for (selectors.v.slice()) |*sel| {
if (sel.len() == 1) {
const component: *const css.selector.parser.Component = &sel.components.items[0];
switch (component.*) {
.class => |id| {
for (composes.names.items) |name| {
for (composes.names.slice()) |name| {
const reference: CssModuleReference = if (composes.from) |*specifier|
switch (specifier.*) {
.source_index => |dep_source_index| {
@@ -231,7 +231,7 @@ pub const Pattern = struct {
closure: anytype,
comptime writefn: *const fn (@TypeOf(closure), []const u8, replace_dots: bool) void,
) void {
for (this.segments.items) |*segment| {
for (this.segments.slice()) |*segment| {
switch (segment.*) {
.literal => |s| {
writefn(closure, s, false);