PHP Developers Network
http://forums.devnetwork.net/

Add line-height to text within [syntax=php][/syntax] tags
http://forums.devnetwork.net/viewtopic.php?f=7&t=130042
Page 1 of 1

Author:  MichaelR [ Sun Jun 19, 2011 6:42 am ]
Post subject:  Add line-height to text within [syntax=php][/syntax] tags

At the moment it's quite difficult to read the code people provide because of the lack of line-height/leading. Using { line-height: 1.2; } seems to be the preferred option.

Author:  McInfo [ Sun Jun 19, 2011 12:13 pm ]
Post subject:  Re: Add line-height to text within [syntax=php][/syntax] tag

If you have Greasemonkey and somewhere to host a CSS file, you can modify the stylesheet however you want (as I do).

This Greasemonkey script appends a new link tag to the head tag of every page on forums.devnetwork.net. The link references a custom stylesheet hosted locally.
Syntax: [ Download ] [ Hide ]
// ==UserScript==
// @name             DevNetwork.net Custom Style
// @namespace        http://localhost/
// @description      Adds a custom stylesheet.
// @include          http://forums.devnetwork.net/*
// ==/UserScript==

var link = document.createElement('link');
link.type = 'text/css';
link.href = 'http://localhost/custom.css';
link.rel = 'stylesheet';
document.head.appendChild(link);

Here is the stylesheet I use.
Syntax: [ Download ] [ Hide ]
.content .syntax {
    background-color: inherit;
    border-width: 0;
    color: #444444;
    display: block;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    line-height: 1.2em;
    margin: 0 0 0 0.2em;
    padding: 0;
    width: auto;
}
.content .syntax-header {
    border-width: 0;
    color: #B4B9BF;
    font-family: Arial, Verdana, Helvetica, sans-serif;
    font-size: 0.8em;
    font-weight: normal;
    margin: 0;
    padding: 0.2em 0;
    text-align: right;
}
.syntax-header a:link, .syntax-header a:visited {
    border-bottom: 1px dotted #B4B9BF;
    color: #B4B9BF;
    text-decoration: none;
}
.syntax-header a:hover, .syntax-header a:active {
    border-bottom: 1px dotted #FF1010;
    color: #FF1010;
    text-decoration: none;
}
.syntax-content {
    background-color: #F4F7F8;
    border-color: #D4D9DF;
    border-style: dotted;
    border-width: 1px 0;
    line-height: 1.2em;
    margin: 0;
    padding: 0;
}
.syntax-content div {
    padding: 0.3em;
}

Author:  social_experiment [ Sun Jun 19, 2011 3:55 pm ]
Post subject:  Re: Add line-height to text within [syntax=php][/syntax] tag


Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/