Commit 451a17f5 authored by Yohan Boniface's avatar Yohan Boniface

Review from pyrates

parent 6ced8784
@font-face {
font-family: 'sans_italic';
font-family: 'sans';
src: url('./font/sourcesanspro-it-webfont.woff2') format('woff2'),
url('./font/sourcesanspro-it-webfont.woff') format('woff');
font-weight: normal;
......@@ -7,15 +7,15 @@
}
@font-face {
font-family: 'sans_light';
font-family: 'sans';
src: url('./font/sourcesanspro-light-webfont.woff2') format('woff2'),
url('./font/sourcesanspro-light-webfont.woff') format('woff');
font-weight: normal;
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'sans_regular';
font-family: 'sans';
src: url('./font/sourcesanspro-regular-webfont.woff2') format('woff2'),
url('./font/sourcesanspro-regular-webfont.woff') format('woff');
font-weight: normal;
......@@ -23,15 +23,15 @@
}
@font-face {
font-family: 'sans_bold';
font-family: 'sans';
src: url('./font/sourcesanspro-bold-webfont.woff2') format('woff2'),
url('./font/sourcesanspro-bold-webfont.woff') format('woff');
font-weight: normal;
font-style: bold;
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'mono_regular';
font-family: 'mono';
src: url('./font/sourcecodepro-regular-webfont.woff2') format('woff2'),
url('./font/sourcecodepro-regular-webfont.woff') format('woff');
font-weight: normal;
......@@ -39,42 +39,42 @@
}
@font-face {
font-family: 'mono_bold';
font-family: 'mono';
src: url('./font/sourcecodepro-bold-webfont.woff2') format('woff2'),
url('./font/sourcecodepro-bold-webfont.woff') format('woff');
font-weight: normal;
font-style: bold;
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'mono_semibold';
font-family: 'mono';
src: url('./font/sourcecodepro-semibold-webfont.woff2') format('woff2'),
url('./font/sourcecodepro-semibold-webfont.woff') format('woff');
font-weight: normal;
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'mono_medium';
font-family: 'mono';
src: url('./font/sourcecodepro-medium-webfont.woff2') format('woff2'),
url('./font/sourcecodepro-medium-webfont.woff') format('woff');
font-weight: normal;
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'mono_italic';
font-family: 'mono';
src: url('./font/sourcecodepro-it-webfont.woff2') format('woff2'),
url('./font/sourcecodepro-it-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
font-style: italic;
}
html, body, a, p, div, li, dl {
margin: 0;
padding: 0;
color: #222;
font-family: 'sans_regular';
font-family: 'sans';
/* font-size: 1.1em;
line-height: 1.4em;
*/}
......
......@@ -5,7 +5,7 @@
<a href="#rules" class="button button-link">Règles de gestion</a>
</section>
<style>
<style scoped>
:scope {
display: block;
padding: 2em;
......@@ -14,22 +14,22 @@
grid-template-columns: 1fr 5fr;
background-color: #68c3a3;
}
:scope h1 {
h1 {
display: inline-block;
font-size: 3em;
line-height: 1em;
}
:scope section a {
section a {
font-size: 1.4em;
font-variant: small-caps;
}
:scope section a:hover {
section a:hover {
text-decoration: underline dotted;
}
:scope a + a {
a + a {
margin-left: 1em;
}
:scope * {
* {
display: flex;
align-items: center;
}
......
<rules>
<div each={ raw, name in items }>
<h3>{name}</h3>
<pre data-is=raw content="{ raw }"/>
<pre data-is=raw content={ raw }/>
</div>
<script>
......@@ -21,36 +21,44 @@
this.mixin(View)
</script>
<style>
:scope pre {
<style scoped>
:scope {
/* Prevent huge comments to overflow */
overflow-x: hidden;
min-width: 1200px;
}
pre {
padding: 5px;
border: solid 1px #68c3a3;
background-color: #eee;
max-width: 1000px;
/*overflow: auto;*/
font-family: 'mono_regular';
max-width: 1200px;
font-family: 'mono';
}
:scope pre strong {
font-family: 'mono_bold';
font-weight: normal;
pre strong {
font-family: 'mono';
font-weight: bold;
}
:scope pre .comment {
font-family: 'mono_italic';
pre .comment {
font-family: 'mono';
font-style: italic;
color: #666;
}
:scope pre .keyword {
font-family: 'mono_semibold';
pre .keyword {
font-family: 'mono';
font-weight: 600;
}
:scope pre .constant {
font-family: 'mono_semibold';
pre .constant {
font-family: 'mono';
font-weight: 600;
text-decoration: underline dotted;
cursor: help;
}
:scope pre .string,
:scope pre .number {
font-family: 'mono_semibold';
pre .string,
pre .number {
font-family: 'mono';
font-weight: 600;
}
:scope h3 {
h3 {
font-variant: small-caps;
}
</style>
......@@ -58,16 +66,15 @@
</rules>
<raw>
raw = opts.content
raw = raw.replace(/Si /g, '<strong>Si </strong>')
raw = raw.replace(/Ou /g, '<strong>Ou </strong>')
raw = raw.replace(/, ou /g, '<strong>, ou </strong>')
raw = raw.replace(/Et /g, '<strong>Et </strong>')
raw = raw.replace(/, et /g, '<strong>, et </strong>')
raw = raw.replace(/Alors /g, '<strong>Alors </strong>')
raw = raw.replace(/(#.+)/g, "<em class=comment>$1</em>")
raw = raw.replace(/( \d+)/g, "<span class=number>$1</span>")
raw = raw.replace(/(«.+»)/g, "<span class=string>$1</span>")
raw = opts.content.replace(/Si /g, '<strong>Si </strong>')
.replace(/Ou /g, '<strong>Ou </strong>')
.replace(/, ou /g, '<strong>, ou </strong>')
.replace(/Et /g, '<strong>Et </strong>')
.replace(/, et /g, '<strong>, et </strong>')
.replace(/Alors /g, '<strong>Alors </strong>')
.replace(/(#.+)/g, "<em class=comment>$1</em>")
.replace(/( \d+)/g, "<span class=number>$1</span>")
.replace(/(«.+»)/g, "<span class=string>$1</span>")
for (const [key, schema] of Object.entries(SCHEMA)) {
if (schema.label) {
let replace = `<span class='keyword tooltip'>$1<span class=tooltip-content>`
......@@ -75,7 +82,7 @@
if (schema.value) replace += `<strong>Value</strong> ${schema.value}<br>`
if (schema.source) replace += `<strong>Source</strong> ${schema.source}`
replace += `</span></span>`
raw = raw.replace(new RegExp('(' + schema.label + ')', 'g'), replace)
raw = raw.replace(new RegExp(`(${schema.label})`, 'g'), replace)
}
}
this.root.innerHTML = raw
......
......@@ -13,14 +13,14 @@
this.mixin(View)
</script>
<style>
:scope dt {
<style scoped>
dt {
font-variant: small-caps;
}
:scope dt em {
dt em {
font-variant: normal;
}
:scope dl {
dl {
margin-top: 10px;
}
</style>
......
......@@ -19,17 +19,8 @@
<script>
riot.mount('navbar')
const views = {
// '/': () => riot.mount(''),
'/schema': () => riot.mount('schema'),
'/rules': () => riot.mount('rules'),
// '/feed/*': (link) => riot.mount('editfeed', {link: link}),
// '/territory/*/*/*': (...args) => mount('territory-list', {id: args.join('/')}),
}
for (let name in views) {
route(name, views[name])
}
route('/schema', () => riot.mount('schema'))
route('/rules', () => riot.mount('rules'))
let SCHEMA
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment