Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADAPT-2539: Add stretched-link and writing-mode utilities to v7 #843

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/plugins/components/link/stretched-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Make any HTML element clickable by stretching a nested link
*/
module.exports = function () {
return function ({ addComponents }) {
const components = {
".stretched-link": {
"&::after": {
display: "block",
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
zIndex: "1",
pointerEvents: "auto",
content: '""',
backgroundColor: "transparent",
},
},
};

addComponents(components);
};
};
14 changes: 14 additions & 0 deletions src/plugins/utilities/typography/writing-mode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Writing mode
*/
module.exports = function () {
return function ({ addUtilities }) {
const newUtilities = {
".text-vertical-lr": {
writingMode: "vertical-lr",
},
};

addUtilities(newUtilities);
};
};
14 changes: 9 additions & 5 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/* eslint-disable no-var */
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable prefer-template */
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */
/**
* Tailwind Configuration.
*/

var path = require("path");

var dir = path.resolve(__dirname, "src/plugins");

module.exports = {
Expand Down Expand Up @@ -68,6 +74,7 @@ module.exports = {
require(dir + "/components/form/buttons.js")(),
require(dir + "/components/form/form-elements.js")(),
require(dir + "/components/lists/lists.js")(),
require(dir + "/components/link/stretched-link.js")(),
require(dir + "/components/layout/centered-container.js")(),
require(dir + "/components/layout/grid-gap.js")(),
require(dir + "/components/logo/logo.js")(),
Expand All @@ -87,6 +94,7 @@ module.exports = {
require(dir + "/utilities/link/link-fontweight.js")(),
require(dir + "/utilities/link/link-underline.js")(),
require(dir + "/utilities/scrolling/smooth-scroll.js")(),
require(dir + "/utilities/typography/writing-mode.js")(),

// 3rd Party Plugins;
require("@tailwindcss/aspect-ratio"),
Expand All @@ -108,11 +116,7 @@ module.exports = {
"group-active",
],
borderColor: ["group-focus-within"],
textColor: [
"group-focus-within",
"group-focus-visible",
"group-active",
],
textColor: ["group-focus-within", "group-focus-visible", "group-active"],
},
},
};