Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- <html dir="rtl"> -->
<div class="wrap">
	<div class="o-container">
		<h2>test</h2>
		<div class="c-topics-container">
			<div class="o-bar c-topics-header">
				<div class="o-bar-left">
					<span class="o-bar-item">
						<h2 class="o-bar-title" role="heading" aria-level="3">Topics</h2>
					</span>
				</div>
				<div class="o-bar-right">
					<span class="o-bar-info c-topics-total" href="#">
						<span class="iconify o-icon o-bar-info-icon" data-icon="mdi:file-outline" data-inline="false"></span>
						<span class="o-bar-item-text">43</span>
					</span>
					<a class="o-bar-item o-action c-topics-mark" href="#" data-tooltip="true" title="Mark">
						<span class="iconify o-icon o-action-icon" data-icon="mdi:checkbox-marked-outline" data-inline="false"></span>
					</a>
					<a class="o-bar-item o-action c-topics-collapse" href="#" data-tooltip="true" data-toggle="collapse" data-toggle-tooltip="Expand" title="Collapse">
						<span class="iconify o-icon o-action-icon" data-icon="mdi:chevron-up" data-inline="false"></span>
					</a>
				</div>
			</div>
			<ul class="c-topics" role="rowgroup" data-container="collapse">
				<li class="c-topics-item" role="row">
					<a class="c-topics-media c-topics-unread" href="" title="">
						<svg class="o-icon c-topics-media-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="false" role="img">
							<path fill-rule="evenodd" d="M19 12h-2V8h-4V4H5v16h6v2H5c-1.103 0-2-.897-2-2V4c0-1.102.897-2 2-2h9.414L19 6.586V12zm1 4v1c.48 0 1 .44 1 1v3c0 .48-.44 1-1 1h-4c-.48 0-1-.44-1-1v-3c0-.48.52-1 1-1v-1c0-1.12.88-2 2-2s2 .88 2 2zm-1 1v-1c0-.64-.36-1-1-1s-1 .36-1 1v1h2zm-9-5v-2h2v2h-2zm0 6v-4h2v4h-2z"></path>
						</svg>
					</a>
					<span class="iconify o-icon c-topics-status" data-icon="mdi:star-circle" data-inline="false"></span>
					<h3 class="c-topics-title">
						<a class="c-topics-title-link" href="#first" title="Author: James, Posted: Dec 30 2020">Announce Locked this is really long for testing purposes of a wrapping title on smaller screens</a>
					</h3>
					<div class="c-topics-meta">
						<span class="c-topics-meta-item c-topics-time">
							<span class="iconify o-icon c-topics-meta-icon" data-icon="mdi:clock-outline" data-inline="false"></span>
							<time datetime="{{ item.time }}" title="{{ item.time }}" data-short="{{ item.time }}">5 Years ago</time>
						</span>
						<span class="c-topics-meta-item c-topics-views">
							<span class="iconify o-icon c-topics-meta-icon" data-icon="mdi:file-eye-outline" data-inline="false"></span>
							765
						</span>
						<span class="c-topics-meta-item c-topics-replies">
							<span class="iconify o-icon c-topics-meta-icon" data-icon="mdi:comment-text-outline" data-inline="false"></span>
							78
						</span>
						<a class="c-topics-meta-item c-topics-author" href="./memberlist.php?mode=viewprofile&amp;amp;u=x" style="color: #009900;" data-tooltip="true" title="Im a Dev but has a long name">
							<span class="iconify o-icon c-topics-meta-icon" data-icon="mdi:account-circle-outline" data-inline="false"></span>
							<span class="c-topics-meta-link-text c-topics-author-text">Im a Dev but has a long name</span>
						</a>
						<a class="c-topics-meta-item c-topics-pages" href="#" data-tooltip="true" title="Pages">
							<span class="iconify o-icon c-topics-meta-icon" data-icon="mdi:checkbox-multiple-blank-outline" data-inline="false"></span>
						</a>
						<a class="c-topics-meta-item c-topics-unapproved" href="#" data-tooltip="true" title="Unapproved">
							<span class="iconify o-icon c-topics-meta-icon" data-icon="mdi:alert-decagram-outline" data-inline="false"></span>
						</a>
					</div>
					<a class="c-topics-recent" href="#recent" data-tooltip="true" title="Author: James">
						<time class="c-topics-recent-time" datetime="2016-09-14T19:18:00Z" title="2016-09-14T19:18:00Z" data-short="2016-09-14T19:18:00Z">Dec 30</time>
						<span class="o-avatar-wrap c-topics-avatar-wrap">
							<img class="o-avatar c-topics-avatar" src="https://avatars.githubusercontent.com/u/73081?v=4" alt="User Avatar">
							<span class="o-avatar-online o-action-bar-avatar-online c-topics-avatar-online"></span>
						</span>
					</a>
				</li>
			</ul>
		</div>
	</div>
              
            
!

CSS

              
                
//
// @settings

// Layout Variables
$topic-spacing: 8px;
$topic-media-size: 40px;


// Theme Variables
$topic-media-color: $default-secondary-color !default;
$topic-media-read-color: $default-primary-color !default;


//
// @scss
.c-topics {
	list-style: none;
	margin: 0;
	padding: 0;
	background-color: var(--gray-1300);
	
	&-header {
		border-top-left-radius: 2px;
		border-top-right-radius: 2px;
	}
	
	&-item {
		display: grid;
		grid-template-columns: ($topic-media-size + ($topic-spacing * 4)) (24px + $topic-spacing) auto 72px;
		grid-template-rows: auto;
		grid-template-areas: 
			"media status title recent"
			"media meta meta recent";
		width: 100%;
    	border-top: 1px solid var(--gray-1000);
    	color: var(--gray-50);
		
		@media (min-width: 960px) {
			grid-template-columns: ($topic-media-size + ($topic-spacing * 4)) (24px + $topic-spacing) auto 151px;
		}
		
		&:hover {
		    background-color: rgba(0, 0, 0, 0.125);
    		transition: 0.5s;
		}
	}
	
	&-media {
		padding: ($topic-spacing * 2);
		justify-self: start; 
  		align-self: start;
  		grid-area: media;
		color: $topic-media-color;
		
		@media (min-width: 960px) {
			height: 92px;
			display: inline-flex;
			justify-content: center;
			align-items: center;
		}
		
		&:hover {
			// color: $topic-media-read-color;
		}
		
		&-icon {
			width: $topic-media-size;
			height: $topic-media-size;
		}
	}
	
	&-read {
		color: $topic-media-read-color;
	}
	
	&-unread {
		color: $topic-media-color;
	}
	
	&-status {
		justify-self: start; 
  		align-self: start;
  		grid-area: status;
		margin-right: .5rem;
		margin-top: 1rem;
		margin-bottom: 0.25rem;
	}
	
	&-title {
		margin: 0;
		margin-bottom: 0.25rem;
		font-size: 1.25rem;
    	letter-spacing: calc((0.25 / (1.25 * 16)) * 1em);
    	font-weight: 500;
    	line-height: 1.5rem;
  		justify-self: start;
  		align-self: center;
  		grid-area: title;

		&-link {
			display: inline-block;
			padding-top: 1rem;
			font-size: 14px;
    		letter-spacing: calc((0.25 / (1.25 * 16)) * 1em);
    		font-weight: 500;
    		line-height: 1.5rem;
			
			&:hover {
				text-decoration: underline;
			}
			
			@media (min-width: 768px) {
				font-size: 20px;
			}
		}
	}

	&-meta {
		margin-top: 0.25rem;
		margin-bottom: 1rem;
		justify-self: start; 
		align-self: center; 
		grid-area: meta;
		
		&-item {
			margin-right: 0.5rem;
		}
		
		&-icon {
			margin-right: 0.5rem;
		}
	}
	
	&-time {
		display: none;

		@media (min-width: 960px) {
			display: inline;
		}
	}
	
	&-views {
		display: none;
		
		@media (min-width: 540px) {
			display: inline-block;
		}
	}
	
	&-author {
		display: none;
		
		@media (min-width: 410px) {
			display: inline-block;
		}
		
		&-text {
			display: none;
			
			@media (min-width: 1140px) {
				display: inline;
			}
		}
	}
	
	&-unapproved {
		color: $topic-media-color;
	}

	&-recent {
		padding: ($topic-spacing * 2);
		display: inline-flex;
		justify-self: end; 
		align-self: start;
		grid-area: recent;
		width: 100%;
		
		
		
		@media (min-width: 960px) {
			height: 92px;
			justify-content: center;
			align-items: center;
		}
		
		&-time {
			display: none;
			margin-right: 0.5rem;
			
			@media (min-width: 960px) {
				display: inline-flex;
			}
		}
		
		&:hover .c-topics-recent-time {
			text-decoration: underline;
		}
	}
	
	&-avatar-wrap,
	&-avatar {
		width: 40px;
    	height: 40px;
   		margin: 0;
    	padding: 0;
	}
	
	&-total {
		display: none;

		@media (min-width: 540px) {
			display: inline-flex;
		}
	}
}

.o-bar-info {
	padding-left: 0;
	padding-right: 16px;
	
	&:first-of-type {
		padding-left: 16px;
	}
}
              
            
!

JS

              
                const $collapseToggle = '[data-toggle="collapse"]';
const $collapseToggleParent = '[data-toggle-parent="collapse"]';
const $collapse = '[data-container="collapse"]';
const $tooltip = '[data-tooltip="true"]';
const $tooltipContainer = '[data-tooltip-container="true"]';

/**
 * Clears the active state of the provided elements
 *
 * @param     {object} e       Event
 * @param     {object} $el     The element with the state
 * @param     {object} $toggle The element that contorls the state
 */
const clearToggle = function (e, $el, $toggle) {
	const { target, } = e;

	if (
		!$(target).is($el) &&
		!$(target).parents().is($el) &&
		!$(target).is($toggle) &&
		!$(target).parents().is($toggle)
	) {
		$($el).each(function () {
			$(this).toggleClass('is-active', false);
		});
	}

	$($page).removeAttr('style');
};



/**
 * Toggles the state for Collapse
 *
 * @todo Refactor to toggle function
 * @param     {object} e      Event
 * @constant  {object} $this
 */
$($collapseToggle).click(function (e) {
	const $this = $(this);
	const $that = $this.parents($collapseToggleParent).next($collapse);
	const tip = $this.attr('data-toggle-tooltip');

	e.preventDefault();
	e.stopPropagation();

	$that.toggleClass('is-collapsed');
	$this.attr('data-toggle-tooltip', $this.attr('title'));
	$this.attr('title', tip);
	$this.toggleClass('is-collapsed');
	$($tooltipContainer).remove();
});


//---------------------------------------------

/**
 * Handles state and creation of Tool Tips
 *
 * @param     {object} e      Event
 * @constant  {object} $this
 * @constant  {object} $that
 * @constant  {string} tip
 * @constant  {object} link
 * @constant  {object} tipPos
 * @event     Toggle#ShowTip
 * @event     Toggle#HideTip
 */
$($tooltip).each(function () {
	const $this = $(this);
	let $that = {};
	$this.on({
		mouseenter: () => {
			$('body').append('<span class="c-tooltip" data-tooltip-container="true"></span>');
			$that = $($tooltipContainer);
			$that.append($this.attr('title'));
			const link = $this.offset();
			const tipPos = $that.offset();
			tipPos.top = link.top + $this.innerHeight() + 6;
			if ((tipPos.top + $that.innerHeight() + 6) > ($(window).height() - 8)) {
				tipPos.top = link.top - $that.innerHeight() - 12;
			}

			tipPos.left = (link.left + ($this.innerWidth() / 2)) - ($that.innerWidth() / 2);
			if ((tipPos.left + $that.width()) > ($(window).width() - 8)) {
				tipPos.left = $(window).width() - 8 - $that.innerWidth();
			}

			$that.attr('style', 'left: ' + tipPos.left + 'px; top: ' + tipPos.top + 'px;');
			$that.toggleClass('is-active');
		},
		mouseleave: () => {
			$that.remove();
		},
	});
});

              
            
!
999px

Console