Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dashicons workarounds #53

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Conversation

mreishus
Copy link
Contributor

@mreishus mreishus commented Jan 30, 2025

Now that we've switched our CSS engine to one that preserves unicode escape sequences ( #51 ), we no longer need these dashicons workarounds.

To Test

Visit

http://localhost:4747/get?url=https://wordpress.org/wp-includes/css/dashicons.css

And verify the escape sequences are still there. For example, .dashicons-media-text:before{content:"\f491"}.

Make a /tmp/dashtest.html and open it:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dashicons Test</title>
    <link rel="stylesheet" href="http://localhost:4747/get?url=https://wordpress.org/wp-includes/css/dashicons.css">
    <style>
        body {
            font-family: Arial, sans-serif;
            padding: 20px;
        }
        .icon-container {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            margin-top: 20px;
        }
        .icon-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        .dashicons {
            font-size: 24px;
            width: 24px;
            height: 24px;
            margin-bottom: 5px;
        }
    </style>
</head>
<body>
    <h1>Dashicons Test Page</h1>
    
    <div class="icon-container">
        <div class="icon-item">
            <span class="dashicons dashicons-admin-home"></span>
            <span>Home</span>
        </div>
        <div class="icon-item">
            <span class="dashicons dashicons-admin-users"></span>
            <span>Users</span>
        </div>
        <div class="icon-item">
            <span class="dashicons dashicons-admin-settings"></span>
            <span>Settings</span>
        </div>
        <div class="icon-item">
            <span class="dashicons dashicons-smiley"></span>
            <span>Smiley</span>
        </div>
        <div class="icon-item">
            <span class="dashicons dashicons-admin-post"></span>
            <span>Post</span>
        </div>
    </div>

    <script>
        // Check if dashicons loaded successfully
        window.addEventListener('load', () => {
            const icons = document.querySelectorAll('.dashicons');
            icons.forEach(icon => {
                const computedStyle = window.getComputedStyle(icon);
                const fontFamily = computedStyle.getPropertyValue('font-family');
                if (fontFamily.includes('dashicons')) {
                    console.log('Dashicons loaded successfully!');
                } else {
                    console.log('Dashicons failed to load.');
                }
            });
        });
    </script>
</body>
</html>

@mreishus mreishus merged commit 9ef07db into trunk Jan 30, 2025
1 check passed
@mreishus mreishus deleted the remove/dashicons-workarounds branch January 30, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant