Skip to content

webdevbynight/in-browser-markdown-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - In-browser markdown editor solution

This is a solution to the In-browser markdown editor challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • Create, Read, Update, and Delete markdown documents
  • Name and save documents to be accessed as needed
  • Edit the markdown of a document and see the formatted preview of the content
  • View a full-page preview of the formatted content
  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Bonus: If you're building a purely front-end project, use localStorage to save the current state in the browser that persists when the browser is refreshed
  • Bonus: Build this project as a full-stack application

Screenshot

Screenshot of the solution

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS (via SCSS)
    • custom properties
    • logical properties
    • flexbox
    • grid
  • JavaScript (via TypeScript)
    • localStorage
    • fetch
  • Mobile-first workflow

What I learned

I learnt the ::backdrop pseudo-element to add a background to a modal dialog element.

To display the markdown editor, I first used the textarea element, but I wanted to expand it all over the available height. The easiest way to do it is to use the field-sizing: content CSS declaration; but, the field-sizing property is not supported by Firefox and Safari (Firefox 131- and Safari 18- at the time when I wrote these lines). So, instead of textarea, I used a div with the contenteditable attribute set to "true".

Useful resources

Author

About

This repository is an exercise from a Frontend Mentor challenge.

Topics

Resources

Stars

Watchers

Forks