What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Sass maps store related keys and values—such as theme colors, spacing tokens, and component settings—in one value. Load the built-in module with @use "sass:map", then use namespaced functions such as map.get() to retrieve values. For nested maps, the exact operation matters: a normal merge is shallow, while map.deep-merge() combines nested maps recursively.
How do Sass maps work?
A Sass map is a SassScript value made of key-value pairs, written in parentheses. Keys can be strings or other valid Sass values, and a value can itself be a map. This makes maps useful for keeping related configuration together rather than scattering individual variables across a stylesheet.
This theme map groups colors and spacing tokens:
@use "sass:map";
$theme: (
"colors": (
"primary": #246,
"accent": #c60
),
"spacing": (
"small": 0.5rem,
"large": 2rem
)
);
The outer map has two keys, "colors" and "spacing". Each points to another map. Quoted string keys make their intent clear, and the same key spelling must be used when looking up a value.
How do I get a value from a Sass map?
Use map.get() with the map followed by the key. For a nested value, provide the sequence of keys from the outer map inward:
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
$primary: map.get($theme, "colors", "primary");
Here, $primary is #246. The function returns the value; it does not modify $theme. If the requested key or path is absent, map.get() returns null, so check for key presence when a missing entry needs different handling.
Check whether a key exists
Use map.has-key() to test for an entry. It also accepts a nested key path in supported Dart Sass versions:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
$has-large-spacing: map.has-key($theme, "spacing", "large");
This evaluates to true for the example map. A presence check is useful when a configuration is optional or when a missing path should trigger a deliberate fallback instead of silently producing null.
How do I list or remove map entries?
The sass:map module includes functions for inspecting and changing maps as values. The most commonly useful operations are:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
map.keys($map)returns the map’s keys.map.values($map)returns its values.map.remove($map, $key...)returns a map with the specified key or keys removed.
These functions return Sass values. They do not edit a map in place: assign the returned value to a variable or pass it into another operation. For nested paths, use the newer path-aware signatures only if the Sass compiler used by the project supports them.
How do I merge Sass maps?
Choose a merge based on the depth you intend to change. The distinction matters when a top-level key points to another map.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
| Operation | What it combines | Effect on overlapping nested values | Compatibility note |
|---|---|---|---|
map.merge($map1, $map2) |
Top-level entries | A value in the second map replaces the value for the same top-level key, including an entire nested map. | Use the standard map function signature documented by Sass. |
map.merge($map, $key..., $map2) |
An explicitly selected nested map | Combines entries at the specified nested location. | Nested-path support was added in Dart Sass 1.27.0; verify the project’s implementation and minimum version. |
map.deep-merge($map1, $map2) |
Nested map values recursively | Combines nested maps, replacing conflicting leaf values while retaining non-conflicting entries. | Added in Dart Sass 1.27.0; verify compatibility before relying on it. |
Use a shallow merge for top-level changes
A regular merge is appropriate when the override is intended to replace or add top-level entries. For example, if both maps have a "colors" key whose value is a map, a shallow merge replaces the original "colors" map with the override’s map as a whole. It will not automatically preserve other color entries from the first map.
Use a nested-path merge for one section
In Dart Sass 1.27.0 and later, a key path lets map.merge() target a nested map rather than replacing its parent entry. This is useful when an update should apply only inside one named section. Because this overload is version-sensitive, do not assume it works in every Sass implementation or older compiler.
Recommended Free Tools
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Use a deep merge to preserve other nested entries
If the goal is to override one nested value while retaining sibling entries throughout the maps, use map.deep-merge() in a compatible Dart Sass version:
$base: (color: (primary: navy, secondary: teal));
$override: (color: (primary: maroon));
$combined: map.deep-merge($base, $override);
The result keeps color.secondary as teal and changes color.primary to maroon. A merge returns a new map value, so assign it to a variable if later styles need the combined configuration.
Why use @use "sass:map"?
For module-based Sass, load the built-in map module explicitly and call its functions through the map namespace:
@use "sass:map";
$answer: map.get(("meaning": 42), "meaning");
The @use rule makes members available under a namespace by default, which helps show where a function comes from and avoids relying on global built-in calls. Sass deprecated @import and global built-in function calls beginning with Dart Sass 1.80.0. That date marks the start of the deprecation, not proof that the syntax has been removed. Sass documents migration guidance, including the Sass migrator, on its deprecation page; the module system’s namespace behavior is described in its module-system announcement.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallWhat Sass version do map paths require?
Dart Sass 1.27.0 introduced nested-path access and updates for map.get(), map.has-key(), map.set(), and map.merge(), along with map.deep-merge() and map.deep-remove(). These additions are documented in the Dart Sass changelog. Before using a nested-path signature or a deep operation, check both the project’s compiler and its minimum supported version. The official Sass map reference provides current function signatures and return behavior.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

