Skip to content

Commit

Permalink
only font-family applied on table and code elements (#1399)
Browse files Browse the repository at this point in the history
* only font-family applied on table and code elements

* tests fixed

* test fixes
  • Loading branch information
Heulitig authored Oct 20, 2023
1 parent fb33884 commit 84f38bb
Show file tree
Hide file tree
Showing 51 changed files with 249 additions and 245 deletions.
6 changes: 5 additions & 1 deletion fastn-js/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ let fastn_utils = {

codeElements.forEach(code => {
roleClasses.forEach(roleClass => {
code.classList.add(roleClass);
var roleCls = '.' + roleClass;
let role = fastn_dom.classes[roleCls];
let roleValue = role['value'];
let fontFamily = roleValue['font-family'];
code.style.fontFamily = fontFamily;
});
});

Expand Down
10 changes: 5 additions & 5 deletions ftd/src/js/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,11 @@ impl Text {
let mut component_statements = vec![];
let kernel = create_element(fastn_js::ElementKind::Text, parent, index, rdata);
component_statements.push(fastn_js::ComponentStatement::CreateKernel(kernel.clone()));
component_statements.extend(self.common.to_set_properties(
kernel.name.as_str(),
doc,
rdata,
));
component_statements.push(fastn_js::ComponentStatement::SetProperty(
fastn_js::SetProperty {
kind: fastn_js::PropertyKind::StringValue,
Expand All @@ -1168,11 +1173,6 @@ impl Text {
inherited: rdata.inherited_variable_name.to_string(),
},
));
component_statements.extend(self.common.to_set_properties(
kernel.name.as_str(),
doc,
rdata,
));
component_statements.extend(self.text_common.to_set_properties(
kernel.name.as_str(),
doc,
Expand Down
6 changes: 3 additions & 3 deletions ftd/t/js/01-basic-module.html

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

6 changes: 3 additions & 3 deletions ftd/t/js/01-basic.html

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

10 changes: 5 additions & 5 deletions ftd/t/js/02-property.html

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

Loading

0 comments on commit 84f38bb

Please sign in to comment.