Christiana
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## Introduction With daily advancements in technology and the ever-growing demand for better and more innovative web experiences, the future of [CSS](https://www.css3.com/) looks more exciting than ever. In this article, we will be taking a look at some of the most promising CSS features. These include new CSS modules and improved CSS features that provide more innovative ways to improve the interactivity of websites. Some are already starting to land in browsers, others are likely to gain widespread browser support in 2023, while for one or two the process may be a little longer. The primary goal of this article is to provide a glimpse into the future of CSS and how it will shape the future of web design. ## Upcoming CSS Modules The [CSS Working Group](https://www.w3.org/groups/wg/css) is always looking for ways to improve CSS, and as a result, several upcoming CSS modules are in development. These modules aim to improve the developer's experience, provide greater flexibility, and enhance the capabilities of CSS. Three of the most anticipated CSS modules are [CSS Text Module Level 3](https://www.w3.org/TR/css-text-3/), [CSS Houdini](https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini), and [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties). ### CSS Text Module Level 3 CSS Text Module Level 3 is a specification that enhances the control and styling options for text within HTML documents. It introduces several new properties and features that allow web developers to manipulate and format text in a more precise and flexible manner. These new properties for styling text include both text alignment, and text decoration such as `text-transform`, `text-align`, `text-indent`, `letter-spacing`, `word-spacing`, and `text-shadow`. It also introduces the hyphenation property, which enables developers to control how words are hyphenated in a line of text. With these new properties, developers now have greater control over the appearance of text on a web page. ### How to build with CSS text module level 3 In this first example, we will focus on using `hyphens` and a few other properties to create a simple about OpenReplay subsection. To get started, we will create an HTML file and input the code below. ```htmlembedded! <div> <a href="https://openreplay.com/" target="_blank"> <img src="https://hackmd.io/_uploads/BkUMVCSU2.jpg"> </a> Hi there, my name is Christiana, and I am a frontend developer and technical writer. Let me tell you a little about OpenReplay. OpenReplay is an open-source session replay suite, built for developers and self-hosted for full control over your data. It helps developers spend less time debugging and empowers them to create delightful web experiences. </div> ``` Next is to write CSS code. ```css div { /*This allows div to hyphenate their contents instead of overflowing their containing block, which is particularly important in long-word*/ hyphens: auto; /*This property specifies whether the UA may break at otherwise disallowed points within a line to prevent overflow*/ overflow-wrap: normal; /*specifies additional spacing between “words”.*/ letter-spacing: normal| <length>; /* white space characters are considered collapsible. N/B this can be either set to 'normal', 'nowrap' or 'preline'*/ white-space: normal; /*describes how the last line of a block or a line right before a forced line break is aligned*/ text-align-last: center; } ``` Here is the final result ![](https://hackmd.io/_uploads/r1iVIRS83.png) *Image showing the result of CSS text module level 3 example* ### Can I use CSS Text Module Level 3? Yes, some of the features in CSS Text Module Level 3 are currently supported by modern web browsers.Both hyphenation control and the text-decoration property are currently supported by [Chrome](https://www.google.com/chrome/), [Firefox](https://www.mozilla.org/en-US/firefox/), [Safari](https://www.apple.com/safari/), and [Edge](https://www.microsoft.com/en-us/edge?form=MA13FJ&exp=e00). However, not all features are fully supported across all browsers. You should check the browser compatibility of each property and feature before using them in production. ### CSS Houdini CSS Houdini is a set of APIs that allow developers to extend the capabilities of a web browser’s rendering engine. This groundbreaking set of APIs provides developers with unparalleled control over CSS, empowering them to develop custom styles and effects that were previously unattainable. By leveraging Houdini, developers can create fresh CSS properties, layout algorithms, and animations, enabling them to have more creative freedom and flexibility to build interactive and dynamic websites and applications. While Houdini is still in its early days of adoption, it represents an exciting new frontier in web development with immense potential for future growth and advancement. As the technology develops further, it could revolutionize the web design industry and offer new opportunities for creating exceptional user experiences. ### How to use CSS Houdini To use the CSS Houdini, first we have to create a Javascript file and import the [`Confetti`](https://www.npmjs.com/package/js-confetti) Javascript module into our code. In this article, we will be considering four different examples of what we can create with Houdini. Example 1: **How to use Houdini to create a painting.** The first step is to download the script and install the library from NPM, then import the module and initialize as seen below. `yarn add js-confetti ` ```javascript! import "https://unpkg.com/extra.css/confetti.js"; import JSConfetti from 'js-confetti' const jsConfetti = new JSConfetti() jsConfetti.addConfetti() ``` This will create an HTML Canvas element and add it to the page, **so call it only once!** Next we input the CSS code ```css! body { background: paint(extra-confetti); height: 100vh; margin: 0; } ``` This will give us the painting below. ![](https://i.imgur.com/DEJ3lET.jpg) *Result: Example 1 Painting* Example 2: **How to create curve lines with Houdini** Another dynamic function of Houdini is the creation of different types of curve lines. Again, we must first import the Javascript module. ```javascript! import "https://unpkg.com/extra.css/confetti.js"; ``` Then we write our css codes. ```css! .custom-line-1 { /* This determines all the attributes of the curve line */ --curved-lineHeight: 30; --curved-lineWidth: 5; --curved-lineColor: midnightblue; --curved-lineSpread: 20; } .custom-line-2 { --curved-lineHeight: 5; /* default: element height */ --curved-lineWidth: 2; /* default: 3 */ --curved-lineColor: deeppink; /* default: 'black' */ --curved-lineSpread: 10; /* default: 50 */ height: 10px; } .custom-line-3 { --curved-lineHeight: 5; /* default: element height */ --curved-lineWidth: 5; /* default: 3 */ --curved-lineColor: saddlebrown; /* default: 'black' */ --curved-lineSpread: 2; /* default: 50 */ height: 10px; } ``` Results ![](https://i.imgur.com/wsYdc9f.jpg) *Image showing different curve lines as described in example 2* Example 3: **How to create Parrallelowow with CSS Houdini** Again, import the Javascript confetti module and then write the CSSS code ```css .demo { /* these are the attributes of the parallelowow*/ --parallelowow-tile-width: 40; --parallelowow-base-color: pink; --parallelowow-color-step: 7; --parallelowow-probability: 0.6; --parallelowow-stroke-weight: 0.5; background: paint(parallelowow), var(--parallelowow-base-color); } ``` ![](https://i.imgur.com/nqIJJzd.jpg) *Image showing Parallelowow created in example 3* Example 4: **Creating Connections with CSS Houdini** Again import the module and write the CSS code ```css .demo { --connections-particleColor: (20, 44, 146); --connections-lineColor: (41, 123, 255); --connections-particleAmount: 140; --connections-defaultRadius: 2; --connections-variantRadius: 3; --connections-linkRadius: 60; background: paint(connections); } ``` Result: ![](https://i.imgur.com/RKN6D6i.jpg) *Image showing connections created in example 4* ### Can I use CSS Houdini? This module is only supported by three mainstream desktop browsers which are Chrome, Edge, and Opera. However several tests are still ongoing for other devices. Although it is still in its early stages, CSS Houdini has the potential to revolutionize the way style writers create their works. This is only the tip of the iceberg; many more APIs are still to be made public. The CSS Houdini project is among the most thrilling ones for developers to anticipate in future years. ## Emerging CSS Features To keep up with the ever-evolving landscape of web design, it's important to stay on top of the latest emerging CSS features. These new additions to the CSS specification include advanced [CSS Selectors Level 4](https://www.w3.org/TR/selectors-4/), which provide more granular control over selecting and styling specific elements. Additionally, CSS Flexbox Level 2 introduces even more powerful layout techniques for building responsive and dynamic designs. CSS Scroll Snap provides a way to create engaging and intuitive scrolling experiences, while animation and transition effects continue to evolve with innovative new approaches. Furthermore, these features also address critical web design concerns, such as accessibility and performance optimization. And with these advancements, staying current with emerging CSS features is essential for crafting engaging, modern, and functional websites in the fast-paced world of web design. For this article, we will be exploring the CSS Selector Level 4 and CSS Scroll Snap properties. ### CSS Selectors Level 4 CSS Selectors Level 4 is the most recent incarnation of the CSS selector specification, which governs how CSS styles can be applied to individual HTML elements on a web page. The selectors themselves are an influential and indispensable tool for targeting specific elements and applying custom styles. This latest version introduces a plethora of additional attribute selectors, such as `:matches`, `:not`, and `:has`, that provide enhanced flexibility in selecting elements based on complex criteria. Additionally, several new pseudo-class selectors, such as `:focus-within` and `:focus-visible`, allow for more precise targeting of elements based on their focus state. One particularly noteworthy new selector is the `:nth-match()` selector, which enables more sophisticated targeting of elements based on their position within a set of siblings. This is a significant improvement over the more limited `:nth-child()` and `:nth-of-type()` selectors. ### How to Use To have a grasp of CSS selectors level 4, we will be creating a simple static CSS Selectors Level 4: Overview page utilizing these three selectors `:not`, `:matches` and `Case-sensitivity` attribute selectors. First create an index.html file and copy the code below, or create your own code. ```htmlembedded <article class="not"> <header> <h2 id="not">:not() Negation pseudo-class</h2> </header> <ul> <li class="item test">Hy there, I'm a list item!</li> <li class="item test">Me too!</li> <div class="item">I'm wrong here :(</div> </ul> </article> <article class="matches"> <header> <h2 id="matches">:matches() Matches-any pseudo-class</h2> </header> <ul> <li class="item">Hy there, I'm a list item!</li> <li class="item">Me too!</li> <div class="item">I'm wrong here :(</div> </ul> </article> <article class="case-sensitive"> <header> <h2 id="matches">Attribute selectors: Case-sensitivity</h2> </header> <input type="text" value="Test" class="true"/> <input type="text" value="test" class="true"/> </article> ``` Now create a css file with the code below ```css // Selectors Level 4 .not{ .item:not(li){ // E:not(s1,s2) => E != s1 || s2 color: @false-color; } } .matches{ .item:matches(li), li.item{ color: @true-color; } } .case-sensitive{ input[value="test" i], input[value="test"], input[value="Test"], input[value="tEst"], input[value="teSt"], input[value="tesT"], input[value="TEst"], input[value="TeSt"]{ border: 2px solid @true-color; } } ``` Now it's time to create our index.js file, this file will hold the function that selects the different selectors. ```javascript! var forms = document.querySelectorAll('form'); [].forEach.call(forms, function(form){ console.log(form); form.addEventListener('submit', function(e){ e.preventDefault(); console.log(this); this.classList.add('submitted'); }) }); ``` The results should be displayed with all the different selector active. ![](https://hackmd.io/_uploads/BJR6mkKD2.jpg) ### Can I use CSS Selector Level 4? The current working editor's draft was released on 11 January 2023, and not much information is available as to when it will be available for developers to use. ### CSS Scroll Snap A web browser's CSS scroll snap behavior can be controlled using the helpful collection of features that CSS offers. Some of this functionality has been accessible for some time, while other parts are just now becoming accessible to more recent browser versions. The trend's strongest point is that just one-third of CSS users are aware of it. There are several ways to change how a container's scroll position is shown using the `scroll-snap-type` property. End consumers benefit from a better, more controllable user experience while developers gain greater precision. A snap position can be produced by declaring a desired alignment on an element. The position is the scroll offset at which the nearest ancestor scroll container and element are aligned as specified for the given axis. The following alignments are possible on each axis: start, end, center. Start alignment means that the scroll container snapport start edge should be flushed with the element snap area start edge. Similarly, end and center alignments mean that the scroll container snapport end edge or center should be flushed with the element snap area end edge or center. ![](https://hackmd.io/_uploads/rkjDbKiS3.jpg) *Example of various alignments on horizontal scrolling axis.* ### How to use the CSS scroll snap feature to create custom scrolling experiences First, we need to write our HTML code ```htmlembedded <div class="section"> <div class="section__item">Item 1</div> <div class="section__item">Item 2</div> </div> ``` Then we write the CSS code and introduce the `scroll-snap-type`. This specifies if an element is a scroll snap container, how strictly it snaps, and which axes are considered. To make the container scroll horizontally, we will input the CSS code below ```css /* Horizontal */ .section { display: flex; overflow-x: auto; scroll-snap-type: x; } .section__item { scroll-snap-align: start; } ``` To make the container scroll vertically, we will input the CSS code below. ```css /* Vertical */ .section { height: 250px; overflow-y: auto; scroll-snap-type: y; } .section__item { scroll-snap-align: start; } ``` ![](https://hackmd.io/_uploads/HJ9MdJUU2.png) ### Can I use the CSS Scroll Snap feature? Currently, the scroll snap feature is supported by about 95.89% including Chrome, Edge, Safari, Firefox, operamini, EI ![](https://i.imgur.com/qW6HVbC.jpg) ## Conclusion As we speak, CSS is going through a period of rapid growth and development. A common thread among many of the new features is their ability to improve the quality and efficiency of our code, while also reducing our reliance on pre-processing tools like Sass. Additionally, these updates encourage web developers to embrace the inherent flexibility of the web and to be mindful of the various ways in which users may be accessing their sites. With countless devices and user preferences to consider, today's web designers must be adaptable and considerate, catering to users who may prefer different contrast levels, color schemes, or motion settings. Whether our users rely on screen readers, older devices, or the latest tech, the future of CSS promises to be inclusive, responsive, and endlessly customizable. ## Resources * [CSS Text Module Level 3](https://www.w3.org/TR/css-text-3/). * [Tizen Docs](https://docs.tizen.org/application/web/guides/w3c/ui/text-module/). * [Mozilla Developer Network]( https://developer.mozilla.org/en-US/docs/Web/Houdini) * [Caniuse.com](https://caniuse.com) * [CSS Houdini](https://css-houdini.rocks/) * [W3C Selectors Level 4](https://www.w3.org/TR/selectors-4/) * [Selector Level 4 CR Test Suite](http://test.csswg.org/suites/selectors-4_dev/nightly-unstable/) * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-timeline) * [Scroll-driven Animations W3](https://drafts.csswg.org/scroll-animations-1/)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully