Custom CSS class per trial
See original GitHub issueFrom #831:
This is a design issue with the library that we’ve been thinking about for some time. I think we’re likely to add a feature in the future that adds a custom class to the display element so that styles can be specified in a <style> tag or stylesheet.
The feature might look like this:
var trial = {
type: 'html-keyboard-response',
stimulus: 'apple',
css_classes: ['large-text']
}
And that would add the class .large-text to the root HTML element of jsPsych for that trial. Then one could specify CSS rules that applied to that class.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
The Beginner's Guide to CSS Classes - HubSpot Blog
You can use CSS classes to group HTML elements and then apply custom styles to them. You can make classes and apply them...
Read more >Override Template Elements with Custom CSS
Use the CSS Editor in Experience Builder to add custom CSS that overrides the default template and Theme panel styles. You can also...
Read more >custom css class codes « HTML Form Builder ... - MachForm
This is advanced option. You can add custom CSS classnames to the parent element of the field. This is useful if you would...
Read more >List of Widget CSS Classes | FeedWind
Check out all acceptable CSS commands that can be used to design your custom FeedWind widget. Access the list now.
Read more >CSS .class Selector - W3Schools
To select elements with a specific class, write a period (.) character, followed by the name of the class. You can also specify...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
🚀 merge away!
I added a first draft of a new “Style and Formatting” page to go in the Overview section of the docs: https://github.com/jspsych/jsPsych/blob/feature-css-class-trial/docs/overview/style.md I may have gone overboard - sorry 😬 Please feel free to comment/edit mercilessly!
I also made some changes to the “css-classes-parameter.html” example file, such as adding examples that show how to write more specific CSS selectors, as explained in your earlier comment. Again, happy to get feedback on how to improve this example file.