title: Knockout.js CSS Computed From Observables
body: <p>I have two observables, one that specifies a module name and the other that sets a height for some of its children. I am trying to make a custom css computed observable that includes these two observables like so:</p>
  
  <pre><code>self.moduleId = ko.observable('dbm-name');
  self.slideWidth = ko.observable(75);
  self.css = ko.observable('');
  self.setcss = ko.computed({
      read: function() {
          return '#' + self.moduleId() +
                 ' {\n\tbackground: #fff;\n\tcolor: #000;\n}
                    \n.cont_width {\n\twidth: ' + self.slideWidth() +
                 '%;\n}';
      },
      write: function(value) {
          self.css(value);
          return value;
      }
  });
  </code></pre>
  
  <p>but it should also allow the user to manually write/edit some css. The problem is that once either <code>moduleId</code> or <code>slideWidth</code> is changed the css observable is not updated unless the user goes into the custom css textarea and makes a change (ie. add and remove a space just to get it to update). How can I automatically update the css observable when either of the other two observable values change? Or is there a better way of setting up my css functionality?</p>