
When managing inventory or projects in kintone, you often encounter situations where multiple statuses are displayed on the detail screen. However, if this information is not visually distinguished, it becomes difficult to determine at a glance which information is important.
This is where color-coding statuses using CSS comes in handy. By using JavaScript to evaluate conditions and assign corresponding CSS classes, you can change the appearance based on priority.
Implementation PointsThe mechanism consists of 3 steps・Event Catching: Use the 'app.record.detail.show' event when the detail screen is displayed
・Value Retrieval and Evaluation: Retrieve the status field value with JavaScript and use if-statements for conditional branching
・Class Assignment: Dynamically add CSS classes using 'classList.add()'
・Styling with CSS: Visually emphasize with background colors or left borders (using '!important' is key)
The code can be completed in under 20 linesIt features a concise implementation suitable for programming beginners. You can set different background colors and borders for each status, such as green for 'In Stock' and red for 'Out of Stock'.
Easy to set upSimply select 'JavaScript/CSS Customization' from the kintone app settings, paste the code, and save. No complex environment setup is required.
Can be applied to multiple fieldsEven if you have multiple status fields such as 'Shipping Status' or 'Priority', you can handle them by simply repeating the same logic.
Making kintone even easier to useThis customization significantly improves the readability of the detail screen. Users can quickly grasp important information, leading to improved operational efficiency. Since CSS color settings are also customizable, it is easy to align them with your organization's color scheme rules.
⸻
This article is an excerpt from a Kintune blog post. Read the full article (with diagrams and code) here → https://kintune-ai.com/blog/kintonecss-1
Originally published: https://kintune-ai.com/blog/kintonecss-1