Skip to content

Conversation

@mookums
Copy link
Contributor

@mookums mookums commented Jun 18, 2025

This is a super barebones CSSStyleSheet, mostly for just resolving various Custom Elements complaining about a lack of the CSSStyleSheet interface.

A lot of functionality is not implemented but it seems to allow more components to load on the Reddit example.

pub const CSSStyleSheet = struct {
pub const prototype = *StyleSheet;

css_rules: *CSSRuleList,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a pointer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer a pointer

return .{ .css_rules = rules, .owner_rule = null };
}

pub fn get_ownerRule(_: *CSSStyleSheet) ?*CSSImportRule {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn get_ownerRule(_: *CSSStyleSheet) ?*CSSImportRule {
pub fn get_ownerRule(_: *CSSStyleSheet) ?*CSSImportRule {

Not a big deal. Can also be done in get_cssRules

title: []const u8,
type: []const u8,

pub fn get_disabled(self: *StyleSheet) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn get_disabled(self: *StyleSheet) bool {
pub fn get_disabled(self: *const StyleSheet) bool {

(same as for the other ones)

@karlseguin karlseguin merged commit ef9f828 into main Jun 19, 2025
11 checks passed
@karlseguin karlseguin deleted the css-stylesheet branch June 19, 2025 02:32
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants