Coding Production Workflow Overview
To maintain coding productivity and quality, key points and important considerations are outlined.
This covers HTML coding excluding front-end implementation.
- The listed content is just an example. Please refer to it based on your project requirements and schedule.
- Assumption: The following scenarios are anticipated. Implementing these points will help ensure the overall progress of the project runs smoothly.
- Project:
- In the case of large-scale projects
- In the case of projects that anticipate long-term operation and maintenance
- Structure: When multiple companies or individuals are involved, dividing and sharing tasks
- Project:
Introduction
It is important to code using a component design philosophy that is reusable on CMS.
Example of Componentization
- Header
- Footer
- Headings
- Buttons
- List of articles
- Card UI for listing
- Pagination and more
Checking Materials
Please check the following in advance.
- Page list (site map)
- Screen design document, wireframes
From the page list, confirm whether it is a "dynamic page to be templated in CMS" or a "static page".
Page-level Checks
- Confirm the "items to be output in CMS" and "those that are not".
- In particular, items to be output in CMS (items to be output in HTML) require consideration for operation, which will be discussed later.
- For items to be output in CMS, also check how they will be displayed based on "pattern variations" or "presence/absence of elements".
1. Basic Points
CSS Design | Define and standardize CSS design and naming rules to understand the scope and usage of CSS. Document them in the repository's README or component list.For example, we mainly use:
|
---|---|
Use of Variables | Define styles used across the site using CSS variables or Sass variables for overall style consistency.
|
Utility Classes | If not using a CSS framework, prepare styles for adjusting margins, font sizes, and display. |
Responsive Design |
|
Componentization |
|
Link Settings |
|
Others |
|
2. Points for Reusable Coding
Styles should be coded in a reusable manner, not limited to specific pages but usable across other pages as well.
Overall
NG h4.heading
OK .heading
NG .link a
OK .link-title
NG #column-page .heading
OK .column-heading
When implementing frontend, it is common to add wrapper elements like <div>
. Design your styles to not break even when wrapper elements are added.
NG #column-page > #column-pickup > .column-list
OK .column-list
Form
To set the name
attribute on the Kuroco side, please use selectors like id, class, data attributes in JS and CSS.
NG input[name="company-name"]
OK .input-company-name
3. Performance Optimization
Even if there are no issues in the local or mockup environment, after implementation on the live site, file loading may slow down page rendering speed or cause stuttering.
Web Font | Ensure it can handle slow network environments by:
|
---|---|
Image |
|
Slider | Consider options like LazyLoading for slides beyond the first one. |
4. Coding for WYSIWYG Editors
When applying styles to HTML input in a WYSIWYG editor, make sure to check and note the points and precautions for styling the areas where the editor is used as per the screen design document.
Overall
When styling content in a WYSIWYG editor, specify only the selector for the wrapper element and apply styles to the elements.
// html
<div class="editor">
// The HTML output generated by the editor will be inserted.
</div>
// scss
.editor {
h1 { }
p { }
ul:not([class]) { } // Separate style for when class is added
}
Element Verification
Check the toolbar buttons used and ensure that standard designs are applied. Pay attention if styles are not applied without adding classes, especially when using reset.css.
<h1>
<h2>
<h3>
<h4>
<p>
<strong>
<i>
<u>
<a>
<figure>
<img>
<oembed>
<table>
<ul>
<ol>
<blockquote>
Notes on CKEditor Specifications
Kuroco uses CKEditor5. Note that the following coding is not allowed in the editor. If you need to input complex HTML, change the input field format from WYSIWYG editor to HTML format.
OK <i>nbsp;</i>
NG <i></i>
OK <a href="#"><span>Inline text</span></a>
OK <a href="#"><img src="path.png"></a>
NG <a href="#"><div>Div Block</div></a>
NG <a href="#"><p>Text Block</p></a>
OK <span>SpanText</span>
NG <span>SpanText<span>Child</span></span>
// You need to assign a class name and use a different class name as well.
OK <div><span class="span1">span1</span><span class="span2">span2</span></div>
NG <div><span>No ClassName</span><span>No ClassName</span></div>
NG <div><span class="span1">span1</span><span class="span1">span1</span></div>
In the following cases (inline elements), a <p>
tag will be inserted.
<!-- When writing -->
Text <span>SpanText</span>
<!-- After conversion -->
<p>Text<span>SpanText</span></p>
<!-- Not converted to <p> -->
<div>Text<span>SpanText</span></div>
<!-- When writing -->
<img src="path.png">
<!-- After conversion -->
<p><img src="path.png"></p>
<!-- Not converted to <p> -->
<div><img src="path.png"></div>
<!-- When writing -->
<a href="#">ButtonLink</a>
<!-- After conversion -->
<p><a href="#">ButtonLink</a></p>
<!-- Not converted to <p> -->
<div><a href="#">ButtonLink</a></div>
<!-- When writing -->
<dl>
<dt>Heading</dt>
<dd>Content</dd>
</dl>
<!-- After conversion -->
<dl>
<dt><p>Heading</p></dt>
<dd><p>Content</p></dd>
</dl>
5. Other Points to Note
- Set up meta tags
- Check the screen specifications and set the page title and URL appropriately
Support
If you have any other questions, please contact us or check out Our Slack Community.