Web Tools #540 - CSS Tools, Tailwind, Testing, ChatGPT

Web Tools Weekly
WEB VERSION
Tools for Web Developers

Issue #540 • November 23, 2023

Advertisement

Dominate Online This BFCM With Cloudways Exclusive Deals.
Starting a new development project or seeking a host with dev-friendly features? We’ve got your back with a massive discount.

Choose Cloudways, a managed cloud hosting platform with an extensive feature-set, including an optimized stack, built-in caching mechanism, unlimited PHP workers, and Cloudflare Enterprise, among others.

Cloudways

Developers save time on Cloudways with its quick 1-click operations, letting them focus on other tasks. With Cloudways, you can:
  • Scale effortlessly
  • Stay secure
  • Boost site performance
  • Grow on a budget
And now's the perfect time to get started with Cloudways. Because of this BFCM, we're offering a FLAT 40% off on all our plans for 4 months. Plus, benefit from 40 free website migrations for a seamless switch.

So, start with a 3-day free trial, no credit card needed. Upgrade only when you're satisfied. Don't miss out on this limited offer.

Grab the Offer →

 
 

If you've manipulated HTML with JavaScript, you've likely heard of or used different attribute methods like getAttribute(), setAttribute(), hasAttribute(), and removeAttribute(). Those are all fairly common.

One that seems to have gone unnoticed is the toggleAttribute() method that is now part of the DOM spec. While the other methods have been supported in browsers basically forever, this one was more recent but still has been in use across all modern browsers for quite a few years now.

As the name suggests, this method provides an easy way to toggle an existing HTML attribute. That is, if the attribute exists it will be removed; if it doesn't exist, it will be added. Here's an example that assumes a button element is referenced in a btn variable and an input element is referenced in a myInput variable:

btn.addEventListener('click', function () {
  myInput.toggleAttribute('disabled');
}, false);

Note that I'm applying it to the disabled attribute. This is an example of what's called a Boolean attribute, meaning it's an attribute that doesn't take a value. While the toggleAttribute() method will technically work on any attribute (even one that has a value), it's most useful on Boolean attributes because those are either present or not present and don't depend on a value.

So in the above example, each time the button is clicked, the attribute will be added or removed.

That's the default behaviour of the method, but if you want you can "force" the method to either add or remove the attribute using an optional second parameter:

// force toggle "on" the attribute
myInput.toggleAttribute('disabled', true);

// force toggle "off" the attribute
myInput.toggleAttribute('disabled', false);

The second parameter, as shown above, can be either true or false. A value of "true" forces the toggle to only turn the attribute "on" if it happens to not exist. If it does exist, nothing changes. A value of "false" does the opposite, removing it if it exists and doing nothing if it doesn't exist.

You can try out all three above examples in this CodePen demo.

Whether the optional parameter is used, the method will return true if the attribute is present prior to the toggle and false if it's not.

Now on to this week's tools!
 

CSS and HTML Tools

HTML Bundler
A Webpack plugin that renders HTML templates with referenced source files of styles, scripts, images, etc.

Ribbon Shapes
A gallery of 100+ copy-pasteable pure CSS ribbons, with just about any ribbon style you can imagine included here.

Dominate Online This BFCM With Cloudways Exclusive Deals
Cloudways is a managed cloud hosting platform with an extensive feature set that allows you to scale effortlessly, boost site performance, and grow on a budget. Enjoy a FLAT 40% off on all plans for 4 months in this limited time offer. Start 3-day free trial today, no credit card required.     SPONSORED 

CSS to Tailwind Converter
An online tool to convert CSS rules to their Tailwind equivalents using Tailwind's utility classes.

Tailwind CSS Theme Variants
A Tailwind CSS plugin that registers variants for theming beyond just light and dark modes without needing custom properties.

browser-window
A small, themed, zero-dependency Web Component for creating demos with a fake Safari-esque browser window.

browser-window

qr-code
A dependency-free, SVG-based web component that generates an animatable and customizable QR code.

Nightwind
An automatic, customizable, override-able Tailwind dark mode plugin with automatic dark gradients and smart color mappings.

@tailwindcss/container-queries
A plugin for Tailwind CSS v3.2+ that provides utilities for CSS container queries.

HTML Tags Memory Test
Start typing HTML tags to see how many you can remember. It's a lot harder than it looks as many common tags are easily forgotten without peeking at your code!
 

Testing and Debugging Tools

test262.fyi
An independent daily test262 (standard test suite) runner for many JavaScript engines (V8, SpiderMonkey, LibJS, etc).

Colour Contrast Checker
An online color contrast checker that lets you modify the background and foreground colors using HSL, also available as a Chrome extension.

The Smartest Use of Screentime Yet
With thousands of bite-sized lessons in math, data science, and CS, available on any device, Brilliant allows you to level up in just minutes a day. Make your free time count. Join over 10 million learners worldwide.    SPONSORED 

typejest
A TypeScript package that provides a Jest-like API for making assertions about types, to make sure everything is working as expected.

Fetchbook
A command-line tool designed to help you manage your collections of HTTP requests, based on the standard RequestInit object, and runs in TypeScript with bun.sh.

Scroll-Driven Animations Debugger
A Chrome extension for DevTools that lets you visualize and debug scroll-driven animations (i.e. parallax or similar).

Security Checkup
Security monitoring as a service, currently free and fully functional, to help you find vulnerabilities in your websites and apps.

Security Checkup

PactumJS
A REST API testing tool to automate e2e, integration, contract, and component (or service-level) tests.

Maestro
An easy-to-use automation and testing framework for mobile apps, to easily define and test your mobile app flows.

Image BPP Calculator
Drag and drop an image file below to calculate its bits per pixel (bpp), based on a recent change to how Chrome is calculating Largest Contentful Paint.
 

ChatGPT and AI Tools

AI Anything
A Nuxt/Vue-based starter project that allows anyone to quickly create ChatGPT tools, with access to 100k+ icons and more.

ChatGPT Proxy
One-click deployment of the ChatGPT private proxy, powered by Next.js, with support for server-sent events (SSE).

ChatGPT for Search Engines
A browser extension (Chrome, Firefox, Edge) to display ChatGPT responses alongside Google, Bing, and DuckDuckGo search results.

The Smartest Use of Screentime Yet
With thousands of bite-sized lessons in math, data science, and CS, available on any device, Brilliant allows you to level up in just minutes a day. Make your free time count. Join over 10 million learners worldwide.     SPONSORED 

OpenAI Developer Platform
The official location for docs and tools related to OpenAI's ChatGPT and related technologies, 

Chatbox
A desktop client for multiple cutting-edge LLM models, available on Windows, Mac, and Linux.

Kombai
A new model trained to understand and code UI designs like humans. Prompt it with your design files to get high-quality UI code in one click per component. Free for developers in research preview.

Kombai

AffordHunt
A curated selection of high-quality, budget-friendly AI and SaaS alternatives tailored for indie hackers.

GPTConsole
An advanced terminal that collaborates with you in real-time, from debugging to application generation, execute complex tasks through natural language commands directly from your command line.
 

Commercial Apps and Classifieds

These are commercial apps, affiliate links, PPC ads, and paid classifieds. Buy a Classified here.
ShadowTraffic – A containerized service for generating data to mimic your production traffic.
Bytes – A JavaScript newsletter that's informative and entertaining, for all levels of JS devs.    AD 
Emoji Generator – Create unique, custom emojis in seconds with AI, downloadable in PNG format.
NativeRest – A native, high-performance, memory-efficient REST API client for Windows.
JS/DOM E-Books Bundle – 250+ tips, tricks, and little-known facts, with lots of live code demos.     AD 
Knibble – Create and embed AI-powered chatbots on your website or app.
Pulsly – A simple changelog service for your SaaS product with beautiful widgets and analytics.

An X Post for Thought

Harry Roberts provides a list of some "sensible defaults" for CSS applied to image elements. In the thread he offers a brief explanation of each of the lines in the code snippet.
 
An X Post for Thought
 

Send Me Your Tools!

Made something? Reply to this email or send links via Direct Message on X @LouisLazaris (details here). No tutorials or articles, please. If you have any suggestions for improvement or corrections, feel free to reply to this email.
 

Before I Go...

Here's something new when it comes to accessibility: Accessible Numbers is a one-stop resource dedicated to helping present numbers and data in a way that's more accessible to a wider audience.

Thanks to everyone for subscribing and reading!

Keep tooling,
Louis
@LouisLazaris
PayPal.me/WebToolsWeekly

Older messages

Web Tools #539 - Raw JS, Frameworks, Git/CLI Tools, Jamstack, CMS's

Friday, November 17, 2023

Web Tools Weekly WEB VERSION Issue #539 • November 16, 2023 Advertisement High Performance Barcode Scanning for Web Apps STRICH is a JavaScript library for barcode scanning in web apps. Move your

Web Tools #538 - JS Utilities, JSON, Database Tools, Uncats

Thursday, November 9, 2023

Web Tools Weekly WEB VERSION Issue #538 • November 9, 2023 Advertisement Rapidly Create Custom Browser Mods Stop creating yet another screen. PixieBrix is the first low-code platform to add AI,

Web Tools #537 - Chrome Switches, React, Media/SVG, Build Tools

Thursday, November 2, 2023

Web Tools Weekly WEB VERSION Issue #537 • November 2, 2023 Advertisement Webflow, the Only Visual Development Platform Designed for Agencies Be the one clients can't stop talking about. Trusted by

Web Tools #536 - JSON Reviver, CSS Tools, Testing, JS Utilities

Thursday, October 26, 2023

Web Tools Weekly WEB VERSION Issue #536 • October 26, 2023 Advertisement Webflow, the Only Visual Development Platform Designed for Agencies Be the one clients can't stop talking about. Trusted by

Web Tools #535 - JS Libraries, ChatGPT Tools, React Native

Thursday, October 19, 2023

Web Tools Weekly WEB VERSION Issue #535 • October 19, 2023 Advertisement Webflow, the Only Visual Development Platform Designed for Agencies Be the one clients can't stop talking about. Trusted by

You Might Also Like

Kotlin Weekly #407

Sunday, May 19, 2024

ISSUE #407 19th of May 2024 Hello Kotliners! The Google I/O just finished this week with a huge announcement for us, with Google supporting now Kotlin Multiplatform on Android, and the KotlinConf will

Learn How to Use AI to Reach Your Full Potential, newsletterest1!

Sunday, May 19, 2024

3 Ways AI Can Help Your Writing ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌

Software Testing Weekly - Issue 220

Saturday, May 18, 2024

Software Testing Conferences 📚 View on the Web Archives ISSUE 220 May 18th 2024 COMMENT Welcome to the 220th issue! Have you ever been to a testing conference? They're a great way to learn about

📶 Is a Cellular iPad Worth It? — How to Prevent YouTube From Taking Over Your Screensaver

Saturday, May 18, 2024

Also: This Robot Vacuum Can Clean Stairs, and More! How-To Geek Logo May 18, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to your inbox by

Weekend Reading — Objection-oriented programming

Saturday, May 18, 2024

This week we find a power-up box, replace GitHub Actions with Maven XMLs, avoid the worst website in the world, revisit RTO policies, “listen” to OpenAI employees, watch our Slack private messages, do

Daily Coding Problem: Problem #1445 [Easy]

Saturday, May 18, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Jane Street. The United States uses the imperial system of weights and measures, which

You don’t have to take our word for it…

Saturday, May 18, 2024

You can probably tell how excited we are to re-launch our Gigantic courses – which bring on-demand product management training for today's modern Product Managers and Product Leaders. In fact, we

🐍 New Python tutorials on Real Python

Saturday, May 18, 2024

Hey there, There's always something going on over at realpython.com as far as Python tutorials go. Here's what you may have missed this past week: What Is the __pycache__ Folder in Python? In

Visualized | Life Expectancy by Region (1950-2050F) 📊

Saturday, May 18, 2024

This map shows life expectancy at birth for key global regions, from 1950 to 2050F. View Online | Subscribe Presented by Voronoi: The App Where Data Tells the Story FEATURED STORY Life Expectancy by

New Wi-Fi Vulnerability Enables Network Eavesdropping via Downgrade Attacks

Saturday, May 18, 2024

THN Daily Updates Newsletter cover The DevSecOps Playbook: Deliver Continuous Security at Speed ($19.00 Value) FREE for a Limited Time A must-read guide to a new and rapidly growing field in