| Page 1 of 1 | [ 3 posts ] |
|
Hello everybody, looks like '80's dream about reusable GUI components available everywhere just started to become true here! This is amazing!
So.. I got a question while developing simple in-line string editor. Imagine you have an image title on your page or something and if you signed in (different story) you see "Edit" button and can change the title. Simple widget. So you have some state associated with such widget: disabled (while signed out), enabled (while signed in), edit mode. I was shown that the state is easily can be managed with CSS classes (viewtopic.php?f=92&t=1086) thanks Peter Abrahamsen a lot! So I have CSS that in fact contains some... well... operating logic of my widget. See the example: Code: /* hide edit button if disabled */ .yui-texteditor.yui-texteditor-disabled button.edit { display: none; } /* show empty-message if value is empty only */ .yui-texteditor .yui-texteditor-content .empty-message { display: none; } .yui-texteditor .yui-texteditor-content.empty .empty-message { display: inline; color: grey; } /* show input field and save button in editing mode only */ .yui-texteditor .yui-texteditor-content input { display: none; } .yui-texteditor .yui-texteditor-content button.save { display: none; } .yui-texteditor .yui-texteditor-content.editing input { display: inline; } .yui-texteditor .yui-texteditor-content.editing button.save { display: inline; } /* hide empty-message and edit button in editind mode */ .yui-texteditor .yui-texteditor-content.editing .empty-message { display: none; } .yui-texteditor .yui-texteditor-content.editing button.edit { display: none; } texteditor is the name of my widget. mmm... maybe "stringeditor" would be better? anyway, it's easy to reckon that such widget doesn't work without CSS and in case I share it via CDN or something I should share my CSS too. So... Is there some way intended to do it? Or maybe I don't understand some simple concept and I just do not need to share CSS? |
|
Should I use StyleSheet? http://developer.yahoo.com/yui/3/stylesheet/
|
|
I believe that the assets dir in your gallery source folder is where you put your css in.
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© YUI Library - Site Credits
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group