Skip to content

Commit

Permalink
add inline css
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremykenedy committed Mar 15, 2018
1 parent 2d14b9f commit ca0b73c
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/config/laravelPhpInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@
// See: https://getbootstrap.com/docs/4.0/components/card/#background-and-color
// Example classes: 'text-white bg-primary mb-3'
'bootstrapCardClasses' => '',

// Inline CSS
'usePHPinfoCSS' => true,

];
77 changes: 77 additions & 0 deletions src/resources/assets/css/php-info.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.php-info pre {
margin: 0;
font-family: monospace;
}
.php-info a:link {
color: #009;
text-decoration: none;
background-color: #ffffff;
}
.php-info a:hover {
text-decoration: underline;
}
.php-info table {
border-collapse: collapse;
border: 0;
width: 100%;
box-shadow: 1px 2px 3px #ccc;
}
.php-info .center {
text-align: center;
}
.php-info .center table {
margin: 1em auto;
text-align: left;
}
.php-info .center th {
text-align: center !important;
}
.php-info td {
border: 1px solid #666;
font-size: 75%;
vertical-align: baseline;
padding: 4px 5px;
}
.php-info th {
border: 1px solid #666;
font-size: 75%;
vertical-align: baseline;
padding: 4px 5px;
}
.php-info h1 {
font-size: 150%;
}
.php-info h2 {
font-size: 125%;
}
.php-info .p {
text-align: left;
}
.php-info .e {
background-color: #ccf;
width: 300px;
font-weight: bold;
}
.php-info .h {
background-color: #99c;
font-weight: bold;
}
.php-info .v {
background-color: #ddd;
max-width: 300px;
overflow-x: auto;
word-wrap: break-word;
}
.php-info .v i {
color: #999;
}
.php-info img {
float: right;
border: 0;
}
.php-info hr {
width: 100%;
background-color: #ccc;
border: 0;
height: 1px;
}
1 change: 1 addition & 0 deletions src/resources/assets/css/php-info.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions src/resources/assets/scss/_php-info.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
$color1: #ffffff;
$color2: #009;
$color3: #ccc;
$color4: #666;
$color5: #ccf;
$color6: #99c;
$color7: #ddd;
$color9: #999;

.php-info {
pre {
margin: 0;
font-family: monospace;
}
a {
&:link {
color: $color2;
text-decoration: none;
background-color: $color1;
}
&:hover {
text-decoration: underline;
}
}
table {
border-collapse: collapse;
border: 0;
width: 100%;
box-shadow: 1px 2px 3px $color3;
}
.center {
text-align: center;
table {
margin: 1em auto;
text-align: left;
}
th {
text-align: center !important;
}
}
td {
border: 1px solid $color4;
font-size: 75%;
vertical-align: baseline;
padding: 4px 5px;
}
th {
border: 1px solid $color4;
font-size: 75%;
vertical-align: baseline;
padding: 4px 5px;
}
h1 {
font-size: 150%;
}
h2 {
font-size: 125%;
}
.p {
text-align: left;
}
.e {
background-color: $color5;
width: 50px;
font-weight: bold;
}
.h {
background-color: $color6;
font-weight: bold;
}
.v {
background-color: $color7;
max-width: 50px;
overflow-x: auto;
word-wrap: break-word;
i {
color: $color9;
}
}
img {
float: right;
border: 0;
}
hr {
width: 100%;
background-color: $color3;
border: 0;
height: 1px;
}
}
86 changes: 85 additions & 1 deletion src/resources/views/phpinfo/php-info.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,90 @@
$bootstrapCardClasses = (is_null(config('laravelPhpInfo.bootstrapCardClasses')) ? '' : config('laravelPhpInfo.bootstrapCardClasses'));
@endphp


@if(config('laravelPhpInfo.usePHPinfoCSS'))
<style type="text/css" media="screen">
.php-info pre {
margin: 0;
font-family: monospace;
}
.php-info a:link {
color: #009;
text-decoration: none;
background-color: #ffffff;
}
.php-info a:hover {
text-decoration: underline;
}
.php-info table {
border-collapse: collapse;
border: 0;
width: 100%;
box-shadow: 1px 2px 3px #ccc;
}
.php-info .center {
text-align: center;
}
.php-info .center table {
margin: 1em auto;
text-align: left;
}
.php-info .center th {
text-align: center !important;
}
.php-info td {
border: 1px solid #666;
font-size: 75%;
vertical-align: baseline;
padding: 4px 5px;
}
.php-info th {
border: 1px solid #666;
font-size: 75%;
vertical-align: baseline;
padding: 4px 5px;
}
.php-info h1 {
font-size: 150%;
}
.php-info h2 {
font-size: 125%;
}
.php-info .p {
text-align: left;
}
.php-info .e {
background-color: #ccf;
width: 50px;
font-weight: bold;
}
.php-info .h {
background-color: #99c;
font-weight: bold;
}
.php-info .v {
background-color: #ddd;
max-width: 50px;
overflow-x: auto;
word-wrap: break-word;
}
.php-info .v i {
color: #999;
}
.php-info img {
float: right;
border: 0;
}
.php-info hr {
width: 100%;
background-color: #ccc;
border: 0;
height: 1px;
}
</style>
@endif


@section('content')
<div class="container">
<div class="row">
Expand All @@ -29,7 +113,7 @@
@lang('laravelPhpInfo::laravel-phpinfo.title')
</div>
<div class="{{ $containerBodyClass }}">
<div class="table-responsive php-info">
<div class="php-info">
@php
ob_start();
phpinfo();
Expand Down

0 comments on commit ca0b73c

Please sign in to comment.