diff options
Diffstat (limited to 'assets/sass/@primer/css/truncate')
-rw-r--r-- | assets/sass/@primer/css/truncate/README.md | 25 | ||||
-rw-r--r-- | assets/sass/@primer/css/truncate/index.scss | 1 | ||||
-rw-r--r-- | assets/sass/@primer/css/truncate/truncate.scss | 31 |
3 files changed, 57 insertions, 0 deletions
diff --git a/assets/sass/@primer/css/truncate/README.md b/assets/sass/@primer/css/truncate/README.md new file mode 100644 index 0000000..ae6f88e --- /dev/null +++ b/assets/sass/@primer/css/truncate/README.md @@ -0,0 +1,25 @@ +--- +bundle: "truncate" +generated: true +--- + +# Primer CSS: `truncate` bundle + +## Usage + +Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with: + +```scss +@import "@primer/css/truncate/index.scss"; +``` + +## Build + +The `@primer/css` npm package includes a standalone CSS build of this module in `dist/truncate.css`. + +## License + +[MIT](https://github.com/primer/css/blob/master/LICENSE) © [GitHub](https://github.com/) + + +[scss]: https://sass-lang.com/documentation/syntax#scss diff --git a/assets/sass/@primer/css/truncate/index.scss b/assets/sass/@primer/css/truncate/index.scss new file mode 100644 index 0000000..c391a32 --- /dev/null +++ b/assets/sass/@primer/css/truncate/index.scss @@ -0,0 +1 @@ +@import "./truncate.scss"; diff --git a/assets/sass/@primer/css/truncate/truncate.scss b/assets/sass/@primer/css/truncate/truncate.scss new file mode 100644 index 0000000..8590f1b --- /dev/null +++ b/assets/sass/@primer/css/truncate/truncate.scss @@ -0,0 +1,31 @@ +// Truncate +// +// css-truncate will shorten text with an ellipsis. + +.css-truncate { + + // css-truncate-auto will shorten text with an ellipsis when overflowing + &.css-truncate-overflow, + .css-truncate-overflow, + &.css-truncate-target, + .css-truncate-target { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + // css-truncate-target will shorten text with an ellipsis and a max width + &.css-truncate-target, + .css-truncate-target { + display: inline-block; + max-width: 125px; + vertical-align: top; + } + + &.expandable.zeroclipboard-is-hover .css-truncate-target, + &.expandable.zeroclipboard-is-hover.css-truncate-target, + &.expandable:hover .css-truncate-target, + &.expandable:hover.css-truncate-target { + max-width: 10000px !important; + } +} |