Tutorialsteacher

Follow Us

Articles
  • C#
  • C# OOP
  • ASP.NET Core
  • ASP.NET MVC
  • LINQ
  • Inversion of Control (IoC)
  • Web API
  • JavaScript
  • TypeScript
  • jQuery
  • Angular 11
  • Node.js
  • D3.js
  • Sass
  • Python
  • Go lang
  • HTTPS (SSL)
  • Regex
  • SQL
  • SQL Server
  • PostgreSQL
  • MongoDB
  • Sass - Get Started
  • What is Sass
  • Sass - Setup Environment
  • Sass - Syntax
  • Sass - Variable
  • Sass - Script
  • Sass - Data Types
  • Sass - Operators
  • Sass - Functions
  • String Functions
  • Numeric Functions
  • List Functions
  • Map Functions
  • Selector Functions
  • Introspection Functions
  • Color Functions
  • Control Directives
  • Import Files and Partials
  • Sass - Mixins
  • Sass - Inheritance
Entity Framework Extensions - Boost EF Core 9
  Bulk Insert
  Bulk Delete
  Bulk Update
  Bulk Merge

Sass - Map Functions

Remember that in Sass the map data type represents one or more key value pairs. In addition to the map-specific functions in the table below, you can use any of the list functions with maps as well; the map will be treated as a set of two-element lists:

nth(("red": #ff0000, "green": #00ff00), 2) //returns ("green" #00ff00)

Like lists, Sass maps are immutable. The map functions that return a map return a new map; they do not change the original arguments.

FunctionDescriptionExamples
map-get($map, $key)Returns the value associated with the specified keymap-get(("red": #ff0000, "green": #00ff00), "green")

Result:
#00ff00
map-merge($map1, $map2)Returns a map containing $map2 appended to the end of $map1map-merge(("red": #ff0000, "green": #00ff00), ("blue": #0000ff)

Result:
("red": #ff0000, "green": #00ff00, "blue": #0000ff)
map-remove($map, $keys)Returns a map without the specified keysmap-remove(("red": #ff0000, "green": #00ff00), "red")

Result:
("green": #00ff00)
map-keys($map)Returns a list of the keys in the specified mapmap-keys(("red": #ff0000, "green": #00ff00))

Result:
("red", "green")
map-values($map)Returns a list of the values in the specified mapmap-values(("red": #ff0000, "green": #00ff00))

Result:
(#ff0000, #00ff00)
map-has-key($map, $key)Returns a Boolean value indicating whether the specified map contains the specified keymap-has-key(("red": #ff0000, "green": #00ff00), blue)

Result:
false
TUTORIALSTEACHER.COM

TutorialsTeacher.com is your authoritative source for comprehensive technologies tutorials, tailored to guide you through mastering various web and other technologies through a step-by-step approach.

Our content helps you to learn technologies easily and quickly for learners of all levels. By accessing this platform, you acknowledge that you have reviewed and consented to abide by our Terms of Use and Privacy Policy, designed to safeguard your experience and privacy rights.

[email protected]

ABOUT USTERMS OF USEPRIVACY POLICY
copywrite-symbol

2024 TutorialsTeacher.com. (v 1.2) All Rights Reserved.