- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Selectors
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS Data Type - <dashed-ident>
CSS data type <dashed-ident> represents any string that behaves as an identifier, generally formatted with dashes.
Syntax
The syntax of <dashed-ident> is similar to the CSS identifiers, such as property names, but it is case-sensitive. It initiates with two dashes, followed by the user-defined identifier. An example as shown below:
body { --green-color: green; --pink-color: pink; --blue-color: blue; }
The double dash at the start of a CSS code block makes it easily recognizable and prevents name clashes with standard CSS keywords.
Like <custom-ident>, <dashed-ident> are defined by the user, but CSS does not define <dashed-ident>.
CSS <dashed-ident> - With Custom Properties
The following example demonstrates using <dashed-ident> with custom property. Here we use the var() function to access its value −
<html> <head> <style> body { --green-color: green; --pink-color: pink; --blue-color: blue; } h1,h4 { color: var(--green-color); } h2,h5 { color: var(--pink-color); } h3,h6 { color: var(--blue-color); } </style> </head> <body> <h6>Heading h6</h6> <h5>Heading h5</h5> <h4>Heading h4</h4> <h3>Heading h3</h3> <h2>Heading h2</h2> <h1>Heading h1</h1> </body> </html>
CSS <dashed-ident> - With @color-profile
When using <dashed-ident> with a CSS color() function, the @color-profile at-rule must be declared first. −
@color-profile --my-color-profile { src: url(""https://example.com/your-color-profile.icc"); } .box { background-color: color(--my-color-profile 0% 60% 30% 0%); }
CSS <dashed-ident> - With @font-palette-values
The following example demonstrates the use of the <dashed-ident> is used with the @font-palette-values at-rule, the at-rule is declared first and then used to set the font-palette property. −
<html> <head> <style> @font-palette-values MyCustomFontPalette { primary-font: 'Arial', sans-serif; accent-font: 'Georgia', serif; heading-font: 'Helvetica', sans-serif; } h1,h2,h3,h4 { font-palette: MyCustomFontPalette; font: 20px MyCustomFontPalette('primary-font'); color: red; } </style> </head> <body> <h1>This is a heading</h1> <h2>Another heading</h2> <h3>Yet another heading</h3> <h4>One more heading</h4> </body> </html>
To Continue Learning Please Login
Login with Google