| 24 | } |
| 25 | |
| 26 | std::string StyleSheetStyle::build( bool emitMediaQueryStart, bool emitMediaQueryEnd ) { |
| 27 | std::string css; |
| 28 | |
| 29 | if ( emitMediaQueryStart && mMediaQueryList && !mMediaQueryList->getQueryString().empty() ) |
| 30 | css += mMediaQueryList->getQueryString() + " {\n\n"; |
| 31 | |
| 32 | css += mSelector.getName() + " {\n"; |
| 33 | |
| 34 | for ( auto& it : mVariables ) |
| 35 | css += "\t" + it.second.getName() + ": " + it.second.getValue() + ";\n"; |
| 36 | |
| 37 | for ( auto& it : mProperties ) { |
| 38 | StyleSheetProperty& prop = it.second; |
| 39 | |
| 40 | css += "\t" + prop.getName() + ": " + prop.getValue() + ";\n"; |
| 41 | } |
| 42 | |
| 43 | css += "}\n\n"; |
| 44 | |
| 45 | if ( emitMediaQueryEnd && mMediaQueryList && !mMediaQueryList->getQueryString().empty() ) |
| 46 | css += "}\n\n"; |
| 47 | |
| 48 | return css; |
| 49 | } |
| 50 | |
| 51 | const StyleSheetSelector& StyleSheetStyle::getSelector() const { |
| 52 | return mSelector; |