Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
István Bozsó committed Apr 1, 2020
1 parent b132724 commit 398d870
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 186 deletions.
267 changes: 82 additions & 185 deletions css/notes.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
/*<meta />*/
/*This stylesheet has styled boxes that are configured to use images*/

@import url('//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');

.fbox {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
align-content: center;
}

.fbox figcaption, figure {
text-align: center;
position: relative;
}

.fbox img {
position: relative;
display: block;
page-break-before: auto;
page-break-after: auto;
page-break-inside: avoid;
}

/* Three image containers (use 25% for four, and 50% for two, etc) */
.column2 {
float: left;
Expand Down Expand Up @@ -87,194 +111,65 @@ p {
margin-top: 8px;
}

p.note {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: #f0f7fb;
background-position: 9px 0px;
background-repeat: no-repeat;
border: solid 1px #3498db;
border-radius: 6px;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

p.warning {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: #f9e7e5;
background-position: 9px 0px;
background-repeat: no-repeat;
border: solid 1px #c0392b;
border-radius: 6px;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

p.example {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: #e7f6f0;
background-position: 9px 0px;
background-repeat: no-repeat;
border: solid 1px #27ae60;
border-radius: 6px;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

p.tip {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: #fffbea;
background-position: 9px 0px;
background-repeat: no-repeat;
border: solid 1px #f1c40f;
border-radius: 6px;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

p.noteAlt {
background-color: #f0f7fb;
background-position: 9px 0px;
background-repeat: no-repeat;
border-left: solid 4px #3498db;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

p.warningAlt {
background-color: #fcf7f2;
background-position: 9px 0px;
background-repeat: no-repeat;
border-left: solid 4px #e74c3c;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

p.exampleAlt {
background-color: #e7f6f0;
background-position: 9px 0px;
background-repeat: no-repeat;
border-left: solid 4px #2ecc71;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

p.tipAlt {
background-color: #fffbea;
background-position: 9px 0px;
background-repeat: no-repeat;
border-left: solid 4px #f1c40f;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}


/*Div styles*/

div.note {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: #f0f7fb;
background-position: 9px 0px;
background-repeat: no-repeat;
border: solid 1px #3498db;
border-radius: 6px;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

div.warning {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: #f9e7e5;
background-position: 9px 0px;
background-repeat: no-repeat;
border: solid 1px #c0392b;
border-radius: 6px;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

div.example {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: #e7f6f0;
background-position: 9px 0px;
background-repeat: no-repeat;
border: solid 1px #27ae60;
border-radius: 6px;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

div.tip {
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
background-color: #fffbea;
background-position: 9px 0px;
background-repeat: no-repeat;
border: solid 1px #f1c40f;
border-radius: 6px;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

div.noteAlt {
background-color: #f0f7fb;
background-position: 9px 0px;
background-repeat: no-repeat;
border-left: solid 4px #3498db;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

div.warningAlt {
background-color: #fcf7f2;
background-position: 9px 0px;
background-repeat: no-repeat;
border-left: solid 4px #e74c3c;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

div.exampleAlt {
background-color: #e7f6f0;
background-position: 9px 0px;
background-repeat: no-repeat;
border-left: solid 4px #2ecc71;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
}

div.tipAlt {
background-color: #fffbea;
background-position: 9px 0px;
background-repeat: no-repeat;
border-left: solid 4px #f1c40f;
line-height: 18px;
overflow: hidden;
padding: 15px 60px;
.info, .success, .warning, .error {
padding:10px;
margin:10px 0;

}

.info:before, .success:before, .warning:before, .error:before {
font-family:FontAwesome;
font-style:normal;
font-weight:400;
speak:none;
display:inline-block;
text-decoration:inherit;
width:1em;
margin-right:.2em;
text-align:center;
font-variant:normal;
text-transform:none;
line-height:1em;
margin-left:.2em;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale
}

.info:before {
content:"\f05a";
}

.success:before {
content:'\f00c';
}

.warning:before {
content:'\f071';
}

.error:before {
content:'\f057';
}

.info {
color: #00529B;
background-color: #BDE5F8;
}

.success {
color: #4F8A10;
background-color: #DFF2BF;
}

.warning {
color: #9F6000;
background-color: #FEEFB3;
}

.error {
color: #D8000C;
background-color: #FFD2D2;
}

/*Targets the caption text*/
table caption {
Expand All @@ -285,6 +180,8 @@ table caption {
table {
border-collapse: collapse;
text-align: center;
page-break-inside:avoid;
page-break-after:auto
}

th, td {
Expand Down
1 change: 1 addition & 0 deletions utils/html/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from utils.base import export
from utils.simpledoc import SimpleDoc, _attributes
from utils.html import encoder

__all__ = (
"ImagePaths", "HTML", "Library",
Expand Down
5 changes: 4 additions & 1 deletion utils/html/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from utils import str_t

__all__ = (
"Encoder", "url_regex",
"Encoder", "url_regex", "encoder",
)

url_regex = re.compile("^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$")
Expand Down Expand Up @@ -93,3 +93,6 @@ def __call__(self, media_path):
return self.tpl.format(
klass=klass, mode=mode, data=data.decode("utf-8")
)


encoder = Encoder()

0 comments on commit 398d870

Please sign in to comment.