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

Add ellipsis and no-ellipsis utilities #1289

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 40 additions & 0 deletions __tests__/fixtures/tailwind-output-important.css
Expand Up @@ -8117,6 +8117,14 @@ video {
text-decoration: none !important;
}

.ellipsis {
text-overflow: ellipsis !important;
}

.no-ellipsis {
text-overflow: clip !important;
}

.antialiased {
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale !important;
Expand Down Expand Up @@ -17810,6 +17818,14 @@ video {
text-decoration: none !important;
}

.sm\:ellipsis {
text-overflow: ellipsis !important;
}

.sm\:no-ellipsis {
text-overflow: clip !important;
}

.sm\:antialiased {
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale !important;
Expand Down Expand Up @@ -27504,6 +27520,14 @@ video {
text-decoration: none !important;
}

.md\:ellipsis {
text-overflow: ellipsis !important;
}

.md\:no-ellipsis {
text-overflow: clip !important;
}

.md\:antialiased {
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale !important;
Expand Down Expand Up @@ -37198,6 +37222,14 @@ video {
text-decoration: none !important;
}

.lg\:ellipsis {
text-overflow: ellipsis !important;
}

.lg\:no-ellipsis {
text-overflow: clip !important;
}

.lg\:antialiased {
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale !important;
Expand Down Expand Up @@ -46892,6 +46924,14 @@ video {
text-decoration: none !important;
}

.xl\:ellipsis {
text-overflow: ellipsis !important;
}

.xl\:no-ellipsis {
text-overflow: clip !important;
}

.xl\:antialiased {
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale !important;
Expand Down
40 changes: 40 additions & 0 deletions __tests__/fixtures/tailwind-output.css
Expand Up @@ -8117,6 +8117,14 @@ video {
text-decoration: none;
}

.ellipsis {
text-overflow: ellipsis;
}

.no-ellipsis {
text-overflow: clip;
}

.antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down Expand Up @@ -17810,6 +17818,14 @@ video {
text-decoration: none;
}

.sm\:ellipsis {
text-overflow: ellipsis;
}

.sm\:no-ellipsis {
text-overflow: clip;
}

.sm\:antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down Expand Up @@ -27504,6 +27520,14 @@ video {
text-decoration: none;
}

.md\:ellipsis {
text-overflow: ellipsis;
}

.md\:no-ellipsis {
text-overflow: clip;
}

.md\:antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down Expand Up @@ -37198,6 +37222,14 @@ video {
text-decoration: none;
}

.lg\:ellipsis {
text-overflow: ellipsis;
}

.lg\:no-ellipsis {
text-overflow: clip;
}

.lg\:antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down Expand Up @@ -46892,6 +46924,14 @@ video {
text-decoration: none;
}

.xl\:ellipsis {
text-overflow: ellipsis;
}

.xl\:no-ellipsis {
text-overflow: clip;
}

.xl\:antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down
2 changes: 2 additions & 0 deletions src/corePlugins.js
Expand Up @@ -60,6 +60,7 @@ import fontSize from './plugins/fontSize'
import fontStyle from './plugins/fontStyle'
import textTransform from './plugins/textTransform'
import textDecoration from './plugins/textDecoration'
import textOverflow from './plugins/textOverflow'
import fontSmoothing from './plugins/fontSmoothing'
import letterSpacing from './plugins/letterSpacing'
import userSelect from './plugins/userSelect'
Expand Down Expand Up @@ -153,6 +154,7 @@ export default function({ corePlugins: corePluginConfig }) {
fontStyle,
textTransform,
textDecoration,
textOverflow,
fontSmoothing,
letterSpacing,
userSelect,
Expand Down
11 changes: 11 additions & 0 deletions src/plugins/textOverflow.js
@@ -0,0 +1,11 @@
export default function() {
return function({ addUtilities, variants }) {
addUtilities(
{
'.ellipsis': { 'text-overflow': 'ellipsis' },
'.no-ellipsis': { 'text-overflow': 'clip' },
},
variants('textOverflow')
)
}
}
1 change: 1 addition & 0 deletions stubs/defaultConfig.stub.js
Expand Up @@ -588,6 +588,7 @@ module.exports = {
textColor: ['responsive', 'hover', 'focus'],
textDecoration: ['responsive', 'hover', 'focus'],
textTransform: ['responsive'],
textOverflow: ['responsive'],
userSelect: ['responsive'],
verticalAlign: ['responsive'],
visibility: ['responsive'],
Expand Down