mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-20 14:32:57 +00:00
Merge branch 'master' into experimentalMarkedDiagrams
This commit is contained in:
+3
-3
@@ -19,7 +19,7 @@ const brewSnippetsToJSON = (menuTitle, userBrewSnippets, themeBundleSnippets=nul
|
||||
userSnippets.push({
|
||||
name : snippetName,
|
||||
icon : '',
|
||||
gen : snipSplit[snips + 1],
|
||||
gen : snipSplit[snips + 1].replace(/\n$/, ''),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ const brewSnippetsToJSON = (menuTitle, userBrewSnippets, themeBundleSnippets=nul
|
||||
if(snippetName.length != 0) {
|
||||
const subSnip = {
|
||||
name : snippetName,
|
||||
gen : snipSplit[snips + 1],
|
||||
gen : snipSplit[snips + 1].replace(/\n$/, ''),
|
||||
};
|
||||
// if(full) subSnip.icon = '';
|
||||
userSnippets.push(subSnip);
|
||||
@@ -91,7 +91,7 @@ const splitTextStyleAndMetadata = (brew)=>{
|
||||
const index = brew.text.indexOf('\n```\n\n');
|
||||
const metadataSection = brew.text.slice(11, index + 1);
|
||||
const metadata = yaml.load(metadataSection);
|
||||
Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang']));
|
||||
Object.assign(brew, _.pick(metadata, ['title', 'description', 'renderer', 'theme', 'lang']));
|
||||
brew.snippets = yamlSnippetsToText(_.pick(metadata, ['snippets']).snippets || '');
|
||||
brew.text = brew.text.slice(index + 6);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const _ = require('lodash');
|
||||
const Markdown = require('markedLegacy');
|
||||
import _ from 'lodash';
|
||||
import Markdown from 'markedLegacy';
|
||||
const renderer = new Markdown.Renderer();
|
||||
|
||||
//Processes the markdown within an HTML block if it's just a class-wrapper
|
||||
@@ -103,7 +103,7 @@ const voidTags = new Set([
|
||||
]);
|
||||
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
marked : Markdown,
|
||||
render : (rawBrewText)=>{
|
||||
return Markdown(
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
|
||||
@import 'naturalcrit/styles/reset.less';
|
||||
//@import 'naturalcrit/styles/elements.less';
|
||||
@import 'naturalcrit/styles/animations.less';
|
||||
@import 'naturalcrit/styles/colors.less';
|
||||
@import 'naturalcrit/styles/tooltip.less';
|
||||
@import './reset.less';
|
||||
//@import './elements.less';
|
||||
@import './animations.less';
|
||||
@import './colors.less';
|
||||
@import './tooltip.less';
|
||||
@font-face {
|
||||
font-family : 'CodeLight';
|
||||
src : data-uri('naturalcrit/styles/CODE Light.otf') format('opentype');
|
||||
src : url('./CODE Light.otf') format('opentype');
|
||||
}
|
||||
@font-face {
|
||||
font-family : 'CodeBold';
|
||||
src : data-uri('naturalcrit/styles/CODE Bold.otf') format('opentype');
|
||||
src : url('./CODE Bold.otf') format('opentype');
|
||||
}
|
||||
html,body, #reactRoot {
|
||||
height : 100vh;
|
||||
|
||||
@@ -3,18 +3,23 @@
|
||||
@arrowSize : 6px;
|
||||
@arrowPosition : 18px;
|
||||
[data-tooltip] {
|
||||
position:relative;
|
||||
.tooltip(attr(data-tooltip));
|
||||
}
|
||||
[data-tooltip-top] {
|
||||
position:relative;
|
||||
.tooltipTop(attr(data-tooltip-top));
|
||||
}
|
||||
[data-tooltip-bottom] {
|
||||
position:relative;
|
||||
.tooltipBottom(attr(data-tooltip-bottom));
|
||||
}
|
||||
[data-tooltip-left] {
|
||||
position:relative;
|
||||
.tooltipLeft(attr(data-tooltip-left));
|
||||
}
|
||||
[data-tooltip-right] {
|
||||
position:relative;
|
||||
.tooltipRight(attr(data-tooltip-right));
|
||||
}
|
||||
.tooltip(@content) {
|
||||
@@ -30,6 +35,7 @@
|
||||
&::before, &::after {
|
||||
bottom : 100%;
|
||||
left : 50%;
|
||||
translate: -50% 0;
|
||||
}
|
||||
&:hover::after, &:hover::before, &:focus::after, &:focus::before {
|
||||
.transform(translateY(-(@arrowSize + 2)));
|
||||
@@ -45,6 +51,7 @@
|
||||
&::before, &::after {
|
||||
top : 100%;
|
||||
left : 50%;
|
||||
translate: -50% 0;
|
||||
}
|
||||
&:hover::after, &:hover::before, &:focus::after, &:focus::before {
|
||||
.transform(translateY(@arrowSize + 2));
|
||||
@@ -57,7 +64,10 @@
|
||||
margin-bottom : -@arrowSize;
|
||||
border-left-color : @tooltipColor;
|
||||
}
|
||||
&::after { margin-bottom : -14px;}
|
||||
&::after {
|
||||
margin-bottom : -14px;
|
||||
max-width : 50ch;
|
||||
}
|
||||
&::before, &::after {
|
||||
right : 100%;
|
||||
bottom : 50%;
|
||||
@@ -73,10 +83,14 @@
|
||||
margin-left : -@arrowSize * 2;
|
||||
border-right-color : @tooltipColor;
|
||||
}
|
||||
&::after { margin-bottom : -14px;}
|
||||
&::after {
|
||||
margin-bottom : -14px;
|
||||
max-width : 50ch;
|
||||
}
|
||||
&::before, &::after {
|
||||
bottom : 50%;
|
||||
top : 50%;
|
||||
left : 100%;
|
||||
translate:0 -50%;
|
||||
}
|
||||
&:hover::after, &:hover::before, &:focus::after, &:focus::before {
|
||||
.transform(translateX(@arrowSize + 2));
|
||||
@@ -106,9 +120,12 @@
|
||||
font-size : 12px;
|
||||
line-height : 12px;
|
||||
color : white;
|
||||
white-space : nowrap;
|
||||
content : @content;
|
||||
background : @tooltipColor;
|
||||
max-width : 60ch;
|
||||
width :max-content;
|
||||
word-break : break-word;
|
||||
overflow-wrap : break-word;
|
||||
}
|
||||
&:hover::before, &:hover::after {
|
||||
visibility : visible;
|
||||
|
||||
Reference in New Issue
Block a user