{"componentChunkName":"component---src-templates-tailwindclass-js","path":"/tailwindcss/classes/tailwind-text-decoration/","result":{"data":{"site":{"siteMetadata":{"title":"Resources to help developers | Contrast | Devwares","docsLocation":""}},"mdx":{"fields":{"id":"2110639a-8bd3-54f2-8a0a-8b0be21fedfb","title":"Tailwind CSS Text Decoration","slug":"/classes/tailwind-text-decoration/"},"body":"var _excluded = [\"components\"];\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"lastUpdated\": \"15 May 2024\",\n  \"title\": \"Tailwind CSS Text Decoration\",\n  \"metaTitle\": \"Tailwind CSS Text Decoration\",\n  \"metaDescription\": \"The text-decoration utility class in Tailwind CSS allows you to add visual styles to text decorations such as underline, overline, line-through, and more.\",\n  \"canonicalUrl\": \"https://windframe.dev/tailwind/classes/tailwind-text-decoration\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", null, \"Tailwind Text Decoration\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"text-decoration\"), \" utility class in Tailwind CSS allows you to add visual styles to text decorations such as underline, overline, line-through, and more. With Tailwind's text-decoration class, you can easily enhance the appearance of text elements.\"), mdx(\"h2\", null, \"Applying Text Decoration\"), mdx(\"p\", null, \"To apply text decoration to an element, you can use the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"text-{decoration}\"), \" utility class, where {decoration} represents the desired text decoration style. Here are the available decoration options:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"text-underline: Adds an underline to the text.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"text-overline: Adds a line above the text.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"text-line-through: Adds a line through the text.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"text-no-underline: Removes any text decoration.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-html\"\n  }, \"<p class=\\\"underline\\\">\\n  This is an underlined text.\\n</p>\\n<p class=\\\"overline\\\">\\n  This is an overline text.\\n</p>\\n<p class=\\\"line-through\\\">\\n  This is a text with line through .\\n</p>\\n<p class=\\\"no-underline\\\">\\n  This is a text with no underline.\\n</p>\\n\")), mdx(\"h2\", null, \"Preview\"), mdx(\"div\", {\n    className: \"relative rounded-xl overflow-auto bg-gray-100 p-8\"\n  }, mdx(\"div\", {\n    className: \"flex flex-col gap-8 text-gray-900\"\n  }, mdx(\"div\", {\n    className: \"text-lg font-medium underline\"\n  }, \"This is an underlined text.\"), mdx(\"div\", {\n    className: \"text-lg font-medium overline\"\n  }, \"This is an overline text.\"), mdx(\"div\", {\n    className: \"text-lg font-medium line-through\"\n  }, \"This is a text with line through .\"), mdx(\"div\", {\n    className: \"text-lg font-medium no-underline\"\n  }, \"This is a text with no underline.\"))), mdx(\"h2\", null, \"Responsive Text Decoration\"), mdx(\"p\", null, \"Tailwind CSS allows you to apply text decoration classes responsively at different breakpoints. To use responsive text decoration classes, you can append the breakpoint prefix to the utility class. For example, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"md:line-through\"), \" applies a line-through decoration to the text starting from the medium breakpoint and above.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-html\"\n  }, \"<p class=\\\"underline md:line-through\\\">\\n  This text is underlined by default, but has a line-through style on medium screens and above.\\n</p>\\n\")), mdx(\"h2\", null, \"Preview\"), mdx(\"div\", {\n    className: \"relative rounded-xl overflow-auto bg-gray-100 p-8\"\n  }, mdx(\"p\", {\n    className: \"underline md:line-through\"\n  }, \"This text is underlined by default, but has a line-through style on medium screens and above.\")), mdx(\"p\", null, \"In the above example, the text is underlined by default (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"underline\"), \"), but starting from the medium breakpoint and above, it has a line-through text decoration (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"md:line-through\"), \").\"), mdx(\"h2\", null, \"Tailwind Text decoration Class Table\"), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Class\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Properties\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"underline\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"text-decoration: underline;\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"line-through\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"text-decoration: line-through;\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"no-underline\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"text-decoration: none;\")))), mdx(\"h2\", null, \"Windframe Tailwind blocks\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://app.windframe.dev/editor?id=header17\"\n  }, \"Landing page\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#tailwind-text-decoration","title":"Tailwind Text Decoration","items":[{"url":"#applying-text-decoration","title":"Applying Text Decoration"},{"url":"#preview","title":"Preview"},{"url":"#responsive-text-decoration","title":"Responsive Text Decoration"},{"url":"#preview-1","title":"Preview"},{"url":"#tailwind-text-decoration-class-table","title":"Tailwind Text decoration Class Table"},{"url":"#windframe-tailwind-blocks","title":"Windframe Tailwind blocks"}]}]},"parent":{"__typename":"File","relativePath":"classes/tailwind-text-decoration.md"},"frontmatter":{"githubUrl":null,"metaTitle":"Tailwind CSS Text Decoration","lastUpdated":"15 May 2024","metaDescription":"The text-decoration utility class in Tailwind CSS allows you to add visual styles to text decorations such as underline, overline, line-through, and more."}}},"pageContext":{"id":"2110639a-8bd3-54f2-8a0a-8b0be21fedfb"}},"staticQueryHashes":["2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","2619113677","3309287076","3309287076","3706406642","3706406642","3706406642","4045616534","4045616534","956403285"]}